Conversation
* Added `DocumentsDB` API with document management methods * Added `VectorsDB` API with vector document methods * Updated API version to 1.9.0 and server compatibility to 1.8.x * Updated CDN script to `appwrite@22.4.1`
Greptile SummaryThis PR introduces two new service classes ( Key findings:
Confidence Score: 4/5
Important Files Changed
|
|
Warning Rate limit exceeded
⌛ 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. WalkthroughThis PR updates the Appwrite Web SDK from version 23.0.0 to 24.0.0 with support for Appwrite server 1.9.x. The release introduces user impersonation capabilities through three new fluent methods on the Client class ( Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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: 6
🧹 Nitpick comments (5)
docs/examples/vectorsdb/list-documents.md (1)
10-17: Consider clarifying thettlparameter value.The example shows
ttl: 0, which may be ambiguous. Consider adding a comment to clarify whether0means "no caching," "use default," or another specific behavior, to help developers understand the parameter's usage.📝 Example with clarified comment
queries: [], // optional transactionId: '<TRANSACTION_ID>', // optional total: false, // optional - ttl: 0 // optional + ttl: 0 // optional - 0 disables caching (or specify time in seconds) });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/examples/vectorsdb/list-documents.md` around lines 10 - 17, Clarify the ttl parameter in the vectorsDB.listDocuments example by updating the inline comment for ttl to state what 0 means (e.g., "0 = no caching" or "0 = use default server TTL") so readers know the behavior; change the comment next to ttl in the vectorsDB.listDocuments call to explicitly describe the intended semantics of 0 and, if relevant, list other accepted values or refer to the API docs for default behavior.docs/examples/databases/upsert-documents.md (1)
13-13: Enhance example with a sample document structure.The empty
documents: []array doesn't show users what structure documents should have. Consider adding at least one example document to demonstrate the expected format and required fields.📚 Suggested improvement
- documents: [], + documents: [ + { + $id: '<DOCUMENT_ID>', + $permissions: [Permission.read(Role.any())], + // your document data + title: 'Example Document', + content: 'Document content here' + } + ],🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/examples/databases/upsert-documents.md` at line 13, Replace the empty documents array used in the example by providing a representative sample document so users see the expected structure; update the documents: [] entry to include at least one object showing common keys (e.g., id or _id, text or content, and a metadata object with example fields like author, timestamp, tags) and a brief realistic text value so callers of the documents array (the documents variable) know required/optional fields and types.docs/examples/documentsdb/list-documents.md (1)
16-16: Consider clarifying the TTL parameter value.The example shows
ttl: 0, which may not represent a meaningful cache duration. Consider using a positive example value (e.g.,ttl: 3600) or adding a comment indicating valid ranges to help users understand appropriate values.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/examples/documentsdb/list-documents.md` at line 16, The example uses ttl: 0 which is ambiguous; update the example in list-documents.md to show a meaningful positive TTL (e.g., ttl: 3600) or add an inline comment clarifying valid ranges/semantics for the ttl parameter so readers understand it represents seconds and that 0 may mean no caching or immediate expiry; locate the ttl example near the documentsdb listing and replace or annotate the ttl: 0 line accordingly.docs/examples/documentsdb/update-document.md (1)
14-14: Enhance example with sample update data.The empty
data: {}object doesn't demonstrate what fields can be updated. Consider adding example fields to show users the expected structure.📚 Suggested improvement
- data: {}, // optional + data: { // optional + username: 'walter.obrien.updated', + age: 31 + },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/examples/documentsdb/update-document.md` at line 14, The example uses an empty update payload (`data: {}`) which doesn't illustrate allowed fields; replace it with a concrete sample object (e.g., `data` containing fields such as title, content or summary, tags array, and metadata/lastModified) so readers see the expected structure and common updatable keys; update the example line that currently shows `data: {}` to include those sample fields and keep values realistic but non-sensitive to clarify usage.docs/examples/documentsdb/decrement-document-attribute.md (1)
14-14: Use a meaningful placeholder for the attribute parameter.The empty string
''is not a valid attribute name and may confuse users. Consider using a descriptive placeholder or example value to demonstrate proper usage.📝 Suggested improvement
- attribute: '', + attribute: 'itemCount', // or use '<ATTRIBUTE_NAME>' as placeholder🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/examples/documentsdb/decrement-document-attribute.md` at line 14, The example uses an empty string for the attribute parameter which is invalid and confusing; update the example in decrement-document-attribute.md to use a meaningful placeholder attribute name (e.g., "count" or "stock") wherever the attribute: '' appears so readers see a real attribute name to decrement, and ensure any explanatory text or adjacent examples reflect that same placeholder (look for the attribute property in the example block).
🤖 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/documentsdb/increment-document-attribute.md`:
- Around line 14-16: The example passes an empty attribute and uses null for
numeric optionals which is invalid; update the snippet so "attribute" is a
meaningful placeholder (e.g., "count" or "views") and either omit the optional
numeric fields or provide valid numbers (e.g., value: 1, max: 10) instead of
null so it matches the API signature value?: number and max?: number.
In `@docs/examples/documentsdb/update-transaction.md`:
- Around line 10-14: The example for documentsDB.updateTransaction is confusing
because it sets both commit: false and rollback: false; update the snippet to
show a realistic workflow by demonstrating one action only (either commit or
rollback). Replace the current example with a commit scenario (set commit: true
and omit rollback) or a rollback scenario (set rollback: true and omit commit),
keeping the transactionId placeholder intact and ensuring the call still uses
documentsDB.updateTransaction and the transactionId, commit, and rollback
parameter names.
In `@docs/examples/vectorsdb/update-transaction.md`:
- Around line 10-14: The example for vectorsDB.updateTransaction is misleading
by setting both commit: false and rollback: false; update the snippet to show a
realistic single-action usage (either commit or rollback). For a commit example
call vectorsDB.updateTransaction({ transactionId: '<TRANSACTION_ID>', commit:
true }) and for a rollback example call vectorsDB.updateTransaction({
transactionId: '<TRANSACTION_ID>', rollback: true }); omit the opposite flag in
each case (or leave it false) so the intended workflow is clear.
In `@README.md`:
- Line 9: The README's server compatibility line conflicts with CHANGELOG.md and
src/index.ts; pick the authoritative target version (e.g., 1.8.x or 1.9.x) and
update all references to match: edit the README sentence that currently says
"This SDK is compatible with Appwrite server version 1.9.x" to the chosen
version, and update the version string in src/index.ts and CHANGELOG.md so all
three sources are identical; ensure the chosen version is used consistently
across README.md, CHANGELOG.md, and src/index.ts.
In `@src/services/documents-db.ts`:
- Around line 421-576: Modify the createDocument and createDocuments helpers to
accept an optional transactionId parameter: add transactionId to the params
object type and to the deprecated positional/rest signatures (for createDocument
it's the 5th/rest[3] param, for createDocuments it's the 3rd/rest[1] param),
extract const transactionId = params.transactionId, validate presence only as
optional (no required check), and include payload['transactionId'] =
transactionId when defined before calling this.client.call; update both
createDocument and createDocuments implementations to handle the new param for
object-style and positional-style invocation.
In `@src/services/vectors-db.ts`:
- Around line 77-89: The overload normalization in createTransaction currently
drops a caller-supplied ttl when passed as 0 because it uses falsy check on
paramsOrFirst; update the conditional to test typeof paramsOrFirst ===
'undefined' (and similarly replace the internal falsy check) so that numeric 0
is preserved and params is set to { ttl: paramsOrFirst as number } when a number
is passed, ensuring createTransaction(paramsOrFirst) correctly normalizes ttl =
0 into params.
---
Nitpick comments:
In `@docs/examples/databases/upsert-documents.md`:
- Line 13: Replace the empty documents array used in the example by providing a
representative sample document so users see the expected structure; update the
documents: [] entry to include at least one object showing common keys (e.g., id
or _id, text or content, and a metadata object with example fields like author,
timestamp, tags) and a brief realistic text value so callers of the documents
array (the documents variable) know required/optional fields and types.
In `@docs/examples/documentsdb/decrement-document-attribute.md`:
- Line 14: The example uses an empty string for the attribute parameter which is
invalid and confusing; update the example in decrement-document-attribute.md to
use a meaningful placeholder attribute name (e.g., "count" or "stock") wherever
the attribute: '' appears so readers see a real attribute name to decrement, and
ensure any explanatory text or adjacent examples reflect that same placeholder
(look for the attribute property in the example block).
In `@docs/examples/documentsdb/list-documents.md`:
- Line 16: The example uses ttl: 0 which is ambiguous; update the example in
list-documents.md to show a meaningful positive TTL (e.g., ttl: 3600) or add an
inline comment clarifying valid ranges/semantics for the ttl parameter so
readers understand it represents seconds and that 0 may mean no caching or
immediate expiry; locate the ttl example near the documentsdb listing and
replace or annotate the ttl: 0 line accordingly.
In `@docs/examples/documentsdb/update-document.md`:
- Line 14: The example uses an empty update payload (`data: {}`) which doesn't
illustrate allowed fields; replace it with a concrete sample object (e.g.,
`data` containing fields such as title, content or summary, tags array, and
metadata/lastModified) so readers see the expected structure and common
updatable keys; update the example line that currently shows `data: {}` to
include those sample fields and keep values realistic but non-sensitive to
clarify usage.
In `@docs/examples/vectorsdb/list-documents.md`:
- Around line 10-17: Clarify the ttl parameter in the vectorsDB.listDocuments
example by updating the inline comment for ttl to state what 0 means (e.g., "0 =
no caching" or "0 = use default server TTL") so readers know the behavior;
change the comment next to ttl in the vectorsDB.listDocuments call to explicitly
describe the intended semantics of 0 and, if relevant, list other accepted
values or refer to the API docs for default behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 18b6e6d2-484f-4b00-bffa-91d4fcfc14a5
📒 Files selected for processing (38)
CHANGELOG.mdREADME.mddocs/examples/databases/upsert-documents.mddocs/examples/documentsdb/create-document.mddocs/examples/documentsdb/create-documents.mddocs/examples/documentsdb/create-operations.mddocs/examples/documentsdb/create-transaction.mddocs/examples/documentsdb/decrement-document-attribute.mddocs/examples/documentsdb/delete-document.mddocs/examples/documentsdb/delete-transaction.mddocs/examples/documentsdb/get-document.mddocs/examples/documentsdb/get-transaction.mddocs/examples/documentsdb/increment-document-attribute.mddocs/examples/documentsdb/list-documents.mddocs/examples/documentsdb/list-transactions.mddocs/examples/documentsdb/update-document.mddocs/examples/documentsdb/update-transaction.mddocs/examples/documentsdb/upsert-document.mddocs/examples/vectorsdb/create-document.mddocs/examples/vectorsdb/create-operations.mddocs/examples/vectorsdb/create-transaction.mddocs/examples/vectorsdb/delete-document.mddocs/examples/vectorsdb/delete-transaction.mddocs/examples/vectorsdb/get-document.mddocs/examples/vectorsdb/get-transaction.mddocs/examples/vectorsdb/list-documents.mddocs/examples/vectorsdb/list-transactions.mddocs/examples/vectorsdb/update-document.mddocs/examples/vectorsdb/update-transaction.mddocs/examples/vectorsdb/upsert-document.mdpackage.jsonrollup.config.jssrc/client.tssrc/index.tssrc/models.tssrc/services/databases.tssrc/services/documents-db.tssrc/services/vectors-db.ts
This PR contains updates to the Web SDK for version 24.0.0.