-
Notifications
You must be signed in to change notification settings - Fork 36
feat: React Native SDK update for version 0.17.0 #77
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
WalkthroughVersion updated to 0.17.0 with a changelog entry. Client header x-sdk-version bumped accordingly. New Models types added: Transaction and TransactionList. Databases and TablesDB services now include transaction management methods: listTransactions, createTransaction, getTransaction, updateTransaction, deleteTransaction, and createOperations. Many existing document/row methods were extended with an optional transactionId parameter, including list/get/create/upsert/update/delete and increment/decrement attribute/column operations. Documentation examples were added or updated across Databases and TablesDB to demonstrate transaction creation, listing, retrieval, update, deletion, createOperations, and passing transactionId in API calls. Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (34)
CHANGELOG.md
(1 hunks)docs/examples/databases/create-document.md
(1 hunks)docs/examples/databases/create-operations.md
(1 hunks)docs/examples/databases/create-transaction.md
(1 hunks)docs/examples/databases/decrement-document-attribute.md
(1 hunks)docs/examples/databases/delete-document.md
(1 hunks)docs/examples/databases/delete-transaction.md
(1 hunks)docs/examples/databases/get-document.md
(1 hunks)docs/examples/databases/get-transaction.md
(1 hunks)docs/examples/databases/increment-document-attribute.md
(1 hunks)docs/examples/databases/list-documents.md
(1 hunks)docs/examples/databases/list-transactions.md
(1 hunks)docs/examples/databases/update-document.md
(1 hunks)docs/examples/databases/update-transaction.md
(1 hunks)docs/examples/databases/upsert-document.md
(1 hunks)docs/examples/tablesdb/create-operations.md
(1 hunks)docs/examples/tablesdb/create-row.md
(1 hunks)docs/examples/tablesdb/create-transaction.md
(1 hunks)docs/examples/tablesdb/decrement-row-column.md
(1 hunks)docs/examples/tablesdb/delete-row.md
(1 hunks)docs/examples/tablesdb/delete-transaction.md
(1 hunks)docs/examples/tablesdb/get-row.md
(1 hunks)docs/examples/tablesdb/get-transaction.md
(1 hunks)docs/examples/tablesdb/increment-row-column.md
(1 hunks)docs/examples/tablesdb/list-rows.md
(1 hunks)docs/examples/tablesdb/list-transactions.md
(1 hunks)docs/examples/tablesdb/update-row.md
(1 hunks)docs/examples/tablesdb/update-transaction.md
(1 hunks)docs/examples/tablesdb/upsert-row.md
(1 hunks)package.json
(1 hunks)src/client.ts
(1 hunks)src/models.ts
(2 hunks)src/services/databases.ts
(26 hunks)src/services/tables-db.ts
(26 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/services/tables-db.ts (1)
src/models.ts (5)
TransactionList
(221-230)Transaction
(1258-1283)Row
(235-264)DefaultRow
(266-269)RowList
(11-20)
src/services/databases.ts (1)
src/models.ts (5)
TransactionList
(221-230)Transaction
(1258-1283)Document
(274-303)DefaultDocument
(305-308)DocumentList
(25-34)
🔇 Additional comments (10)
docs/examples/databases/update-document.md (1)
15-15
: Fix invalid permission string literalThe example currently uses
permissions: ["read("any")"]
, which is not valid JavaScript/TypeScript syntax and will break when copied. Switching the inner quotes fixes it.- permissions: ["read("any")"], // optional + permissions: ['read("any")'], // optionalLikely an incorrect or invalid review comment.
docs/examples/databases/update-transaction.md (1)
1-15
: LGTM!The example clearly demonstrates the
updateTransaction
API usage with proper client configuration and optional parameters.docs/examples/databases/get-document.md (1)
13-14
: LGTM!The addition of
transactionId
as an optional parameter aligns with the transaction support introduced in this release.docs/examples/databases/create-operations.md (1)
1-24
: LGTM!The example effectively demonstrates the
createOperations
API for batching operations within a transaction. The structure is clear and follows the expected format.docs/examples/databases/list-documents.md (1)
12-13
: LGTM!The optional
transactionId
parameter is correctly added and consistent with the transaction API surface expansion.docs/examples/databases/delete-transaction.md (1)
1-13
: LGTM!The example correctly demonstrates the
deleteTransaction
API usage.docs/examples/tablesdb/upsert-row.md (1)
14-15
: LGTM!The addition of
transactionId
is consistent with the transaction support, and the trailing comma improves formatting consistency.docs/examples/tablesdb/create-operations.md (1)
1-24
: LGTM!The example correctly demonstrates
TablesDB.createOperations
for transactional table operations. The structure appropriately mirrors the Databases API counterpart.src/models.ts (2)
218-230
: LGTM!The
TransactionList
type follows the established pattern of other list types in the codebase (e.g.,DocumentList
,RowList
) with a consistent structure.
1255-1283
: LGTM!The
Transaction
type is well-structured with appropriate field types and clear documentation. The status field documents the possible values inline, which is consistent with how other status fields are handled in this codebase.
permissions: ["read("any")"], // optional | ||
transactionId: '<TRANSACTION_ID>' // optional |
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.
Correct the permissions string literal.
["read("any")"]
is syntactically invalid—copying this snippet will throw. Use single quotes (or escape the inner quotes) so developers can paste and run the example as-is.
- permissions: ["read("any")"], // optional
+ permissions: ['read("any")'], // optional
📝 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.
permissions: ["read("any")"], // optional | |
transactionId: '<TRANSACTION_ID>' // optional | |
permissions: ['read("any")'], // optional | |
transactionId: '<TRANSACTION_ID>' // optional |
🤖 Prompt for AI Agents
In docs/examples/databases/create-document.md around lines 20 to 21, the
permissions entry uses invalid nested double quotes ("read("any")"); fix it by
using single quotes for the inner string or by escaping the inner quotes so the
permissions array contains a valid string (for example read('any')), keeping the
transactionId line unchanged.
permissions: ["read("any")"], // optional | ||
transactionId: '<TRANSACTION_ID>' // optional |
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.
Correct the permissions string literal.
"read("any")"
is malformed JavaScript; escaping or switching quote types keeps the example usable.
Apply this diff:
- permissions: ["read("any")"], // optional
+ permissions: ['read("any")'], // optional
📝 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.
permissions: ["read("any")"], // optional | |
transactionId: '<TRANSACTION_ID>' // optional | |
permissions: ['read("any")'], // optional | |
transactionId: '<TRANSACTION_ID>' // optional |
🤖 Prompt for AI Agents
docs/examples/databases/upsert-document.md lines 14-15: the permissions string
literal is malformed ("read("any")"); change it to a valid JS string by either
using single outer quotes with double inner quotes like ['read("any")'], using
double outer quotes and single inner quotes like ["read('any')"], or escaping
the inner quotes like "read(\"any\")", and update the example accordingly so it
parses.
permissions: ["read("any")"], // optional | ||
transactionId: '<TRANSACTION_ID>' // optional |
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.
Fix invalid string literal in example.
"read("any")"
terminates early and breaks copy/paste. Use single quotes outside or escape the inner quotes so the snippet stays valid.
Apply this diff:
- permissions: ["read("any")"], // optional
+ permissions: ['read("any")'], // optional
📝 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.
permissions: ["read("any")"], // optional | |
transactionId: '<TRANSACTION_ID>' // optional | |
permissions: ['read("any")'], // optional | |
transactionId: '<TRANSACTION_ID>' // optional |
🤖 Prompt for AI Agents
In docs/examples/tablesdb/create-row.md around lines 20 to 21 the example has an
invalid string literal permissions: ["read("any")"] which terminates early;
replace it with a valid quoted string such as permissions: ['read("any")'] or
escape the inner quotes permissions: ["read(\"any\")"] so the snippet is
syntactically correct and copy/paste-safe.
permissions: ["read("any")"], // optional | ||
transactionId: '<TRANSACTION_ID>' // optional |
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.
Fix invalid permissions string literal.
["read("any")"]
is not valid JavaScript/TypeScript because the inner quotes terminate the string. The snippet breaks if copied verbatim. Please switch to single quotes (or escape the inner quotes) to keep the example runnable.
- permissions: ["read("any")"], // optional
+ permissions: ['read("any")'], // optional
📝 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.
permissions: ["read("any")"], // optional | |
transactionId: '<TRANSACTION_ID>' // optional | |
permissions: ['read("any")'], // optional | |
transactionId: '<TRANSACTION_ID>' // optional |
🤖 Prompt for AI Agents
In docs/examples/tablesdb/update-row.md around lines 14 to 15, the example uses
an invalid string literal permissions: ["read("any")"] which breaks JS/TS;
change it to use valid quoting or escaping such as permissions: ['read("any")']
or permissions: ["read(\"any\")"] so the inner quotes do not terminate the
string, and update the example accordingly to keep it runnable.
This PR contains updates to the React Native SDK for version 0.17.0.
Summary by CodeRabbit
New Features
Documentation
Chores