-
Couldn't load subscription status.
- Fork 34
feat: Apple SDK update for version 13.1.0 #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Warning Rate limit exceeded@ChiragAgg5k has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 31 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
WalkthroughIntroduces version 13.0.1 updates across docs and SDK. Adds Account APIs createEmailVerification and updateEmailVerification. Marks createVerification and updateVerification as deprecated and points them to the email verification endpoints. Updates internal paths for phone verification endpoints to /account/verifications/phone. Bumps x-sdk-version header to 13.0.1 and updates README Swift Package Manager version to 13.0.1. Adds documentation examples for creating and updating email verification. Updates TablesDb inline documentation links without changing behavior. Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
Sources/Appwrite/Services/Account.swift (2)
2261-2286: Consider refactoring to reduce code duplication.The deprecated
createVerificationmethod duplicates the entire implementation of the newcreateEmailVerificationmethod. To improve maintainability and reduce duplication, the deprecated method could simply delegate to the new one.Apply this diff to eliminate duplication:
@available(*, deprecated, message: "This API has been deprecated since 1.8.0. Please use `Account.createEmailVerification` instead.") open func createVerification( url: String ) async throws -> AppwriteModels.Token { - let apiPath: String = "/account/verifications/email" - - let apiParams: [String: Any?] = [ - "url": url - ] - - let apiHeaders: [String: String] = [ - "content-type": "application/json" - ] - - let converter: (Any) -> AppwriteModels.Token = { response in - return AppwriteModels.Token.from(map: response as! [String: Any]) - } - - return try await client.call( - method: "POST", - path: apiPath, - headers: apiHeaders, - params: apiParams, - converter: converter - ) + return try await createEmailVerification(url: url) }
2340-2367: Consider refactoring to reduce code duplication.The deprecated
updateVerificationmethod duplicates the entire implementation of the newupdateEmailVerificationmethod. Similar tocreateVerification, this could be refactored to delegate to the new method.Apply this diff to eliminate duplication:
@available(*, deprecated, message: "This API has been deprecated since 1.8.0. Please use `Account.updateEmailVerification` instead.") open func updateVerification( userId: String, secret: String ) async throws -> AppwriteModels.Token { - let apiPath: String = "/account/verifications/email" - - let apiParams: [String: Any?] = [ - "userId": userId, - "secret": secret - ] - - let apiHeaders: [String: String] = [ - "content-type": "application/json" - ] - - let converter: (Any) -> AppwriteModels.Token = { response in - return AppwriteModels.Token.from(map: response as! [String: Any]) - } - - return try await client.call( - method: "PUT", - path: apiPath, - headers: apiHeaders, - params: apiParams, - converter: converter - ) + return try await updateEmailVerification(userId: userId, secret: secret) }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
CHANGELOG.md(1 hunks)README.md(1 hunks)Sources/Appwrite/Client.swift(1 hunks)Sources/Appwrite/Services/Account.swift(4 hunks)Sources/Appwrite/Services/TablesDb.swift(4 hunks)docs/examples/account/create-email-verification.md(1 hunks)docs/examples/account/update-email-verification.md(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
Sources/Appwrite/Services/Account.swift (2)
Sources/Appwrite/Client.swift (1)
call(301-332)Sources/Appwrite/Services/Databases.swift (15)
deprecated(22-50)deprecated(63-75)deprecated(92-126)deprecated(143-159)deprecated(173-203)deprecated(217-231)deprecated(248-282)deprecated(299-315)deprecated(330-364)deprecated(379-395)deprecated(407-429)deprecated(444-480)deprecated(495-513)deprecated(528-564)deprecated(579-597)
🪛 markdownlint-cli2 (0.18.1)
docs/examples/account/create-email-verification.md
10-10: Bare URL used
(MD034, no-bare-urls)
🪛 SwiftLint (0.57.0)
Sources/Appwrite/Services/Account.swift
[Error] 2227-2227: Force casts should be avoided
(force_cast)
[Error] 2316-2316: Force casts should be avoided
(force_cast)
🔇 Additional comments (8)
Sources/Appwrite/Services/TablesDb.swift (1)
78-81: Keep camelCase slug for tablesDBRequests to https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable return 200 OK while the lowercase slug returns 404, so no change is needed.
Likely an incorrect or invalid review comment.
Sources/Appwrite/Client.swift (1)
26-26: LGTM! Version header updated correctly.The SDK version header has been properly incremented to 13.0.1, consistent with the version bump across the PR.
README.md (1)
34-34: LGTM! Swift Package Manager dependency version updated correctly.The dependency version has been properly updated to 13.0.1, consistent with the SDK version bump.
docs/examples/account/update-email-verification.md (1)
1-13: LGTM! Clear and correct example.The example demonstrates proper usage of the new
updateEmailVerificationAPI with appropriate placeholders and async/await syntax.docs/examples/account/create-email-verification.md (1)
1-12: LGTM! Clear and correct example.The example demonstrates proper usage of the new
createEmailVerificationAPI with appropriate async/await syntax.Sources/Appwrite/Services/Account.swift (3)
2213-2237: LGTM! New email verification method implemented correctly.The new
createEmailVerificationmethod is properly implemented with correct endpoint path, HTTP method, and return type. The implementation follows established patterns in the codebase.
2300-2326: LGTM! New email verification update method implemented correctly.The new
updateEmailVerificationmethod is properly implemented with the correct endpoint, HTTP method, and parameters. The implementation is consistent with other methods in the service.
2382-2403: LGTM! Phone verification paths updated consistently.The phone verification endpoint paths have been properly updated to use the
/account/verifications/phonenamespace, maintaining consistency with the new email verification structure. The method signatures remain unchanged, preserving backward compatibility.Also applies to: 2417-2443
CHANGELOG.md
Outdated
| ## 13.0.1 | ||
|
|
||
| * Deprecate `createVerification` method in `Account` service | ||
| * Add `createEmailVerification` method in `Account` service | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog is incomplete.
The changelog entry for version 13.0.1 only documents the deprecation of createVerification and the addition of createEmailVerification. However, based on the changes in Sources/Appwrite/Services/Account.swift, the following are also missing:
- Deprecation of
updateVerificationmethod - Addition of
updateEmailVerificationmethod - Internal path updates for phone verification endpoints (
createPhoneVerificationandupdatePhoneVerificationnow use/account/verifications/phone)
Apply this diff to complete the changelog:
## 13.0.1
* Deprecate `createVerification` method in `Account` service
+* Deprecate `updateVerification` method in `Account` service
* Add `createEmailVerification` method in `Account` service
+* Add `updateEmailVerification` method in `Account` service
+* Update phone verification endpoints to use `/account/verifications/phone` path📝 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.
| ## 13.0.1 | |
| * Deprecate `createVerification` method in `Account` service | |
| * Add `createEmailVerification` method in `Account` service | |
| ## 13.0.1 | |
| * Deprecate `createVerification` method in `Account` service | |
| * Deprecate `updateVerification` method in `Account` service | |
| * Add `createEmailVerification` method in `Account` service | |
| * Add `updateEmailVerification` method in `Account` service | |
| * Update phone verification endpoints to use `/account/verifications/phone` path |
🤖 Prompt for AI Agents
In CHANGELOG.md around lines 3 to 7, the 13.0.1 entry is missing several items
present in Sources/Appwrite/Services/Account.swift: add a bullet marking the
deprecation of the updateVerification method, add a bullet for the new
updateEmailVerification method in the Account service, and add a note that
internal paths for phone verification endpoints have changed so
createPhoneVerification and updatePhoneVerification now use
/account/verifications/phone; update the changelog section to include these
three items consistent with the existing style.
This PR contains updates to the Apple SDK for version 13.1.0.