-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Client, Databases } from "react-native-appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
||
const databases = new Databases(client); | ||
|
||
const result = await databases.createOperations({ | ||
transactionId: '<TRANSACTION_ID>', | ||
operations: [ | ||
{ | ||
"action": "create", | ||
"databaseId": "<DATABASE_ID>", | ||
"collectionId": "<COLLECTION_ID>", | ||
"documentId": "<DOCUMENT_ID>", | ||
"data": { | ||
"name": "Walter O'Brien" | ||
} | ||
} | ||
] // optional | ||
}); | ||
|
||
console.log(result); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Client, Databases } from "react-native-appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
||
const databases = new Databases(client); | ||
|
||
const result = await databases.createTransaction({ | ||
ttl: 60 // optional | ||
}); | ||
|
||
console.log(result); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Client, Databases } from "react-native-appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
||
const databases = new Databases(client); | ||
|
||
const result = await databases.deleteTransaction({ | ||
transactionId: '<TRANSACTION_ID>' | ||
}); | ||
|
||
console.log(result); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Client, Databases } from "react-native-appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
||
const databases = new Databases(client); | ||
|
||
const result = await databases.getTransaction({ | ||
transactionId: '<TRANSACTION_ID>' | ||
}); | ||
|
||
console.log(result); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Client, Databases } from "react-native-appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
||
const databases = new Databases(client); | ||
|
||
const result = await databases.listTransactions({ | ||
queries: [] // optional | ||
}); | ||
|
||
console.log(result); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Client, Databases } from "react-native-appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
||
const databases = new Databases(client); | ||
|
||
const result = await databases.updateTransaction({ | ||
transactionId: '<TRANSACTION_ID>', | ||
commit: false, // optional | ||
rollback: false // optional | ||
}); | ||
|
||
console.log(result); |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -11,7 +11,8 @@ const result = await databases.upsertDocument({ | |||||||||
collectionId: '<COLLECTION_ID>', | ||||||||||
documentId: '<DOCUMENT_ID>', | ||||||||||
data: {}, | ||||||||||
permissions: ["read("any")"] // optional | ||||||||||
permissions: ["read("any")"], // optional | ||||||||||
transactionId: '<TRANSACTION_ID>' // optional | ||||||||||
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct the permissions string literal.
Apply this diff: - permissions: ["read("any")"], // optional
+ permissions: ['read("any")'], // optional 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||
}); | ||||||||||
|
||||||||||
console.log(result); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Client, TablesDB } from "react-native-appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
||
const tablesDB = new TablesDB(client); | ||
|
||
const result = await tablesDB.createOperations({ | ||
transactionId: '<TRANSACTION_ID>', | ||
operations: [ | ||
{ | ||
"action": "create", | ||
"databaseId": "<DATABASE_ID>", | ||
"tableId": "<TABLE_ID>", | ||
"rowId": "<ROW_ID>", | ||
"data": { | ||
"name": "Walter O'Brien" | ||
} | ||
} | ||
] // optional | ||
}); | ||
|
||
console.log(result); |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -17,7 +17,8 @@ const result = await tablesDB.createRow({ | |||||||||
"age": 30, | ||||||||||
"isAdmin": false | ||||||||||
}, | ||||||||||
permissions: ["read("any")"] // optional | ||||||||||
permissions: ["read("any")"], // optional | ||||||||||
transactionId: '<TRANSACTION_ID>' // optional | ||||||||||
Comment on lines
+20
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix invalid string literal in example.
Apply this diff: - permissions: ["read("any")"], // optional
+ permissions: ['read("any")'], // optional 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||
}); | ||||||||||
|
||||||||||
console.log(result); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Client, TablesDB } from "react-native-appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
||
const tablesDB = new TablesDB(client); | ||
|
||
const result = await tablesDB.createTransaction({ | ||
ttl: 60 // optional | ||
}); | ||
|
||
console.log(result); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Client, TablesDB } from "react-native-appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
||
const tablesDB = new TablesDB(client); | ||
|
||
const result = await tablesDB.deleteTransaction({ | ||
transactionId: '<TRANSACTION_ID>' | ||
}); | ||
|
||
console.log(result); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Client, TablesDB } from "react-native-appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
||
const tablesDB = new TablesDB(client); | ||
|
||
const result = await tablesDB.getTransaction({ | ||
transactionId: '<TRANSACTION_ID>' | ||
}); | ||
|
||
console.log(result); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Client, TablesDB } from "react-native-appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
||
const tablesDB = new TablesDB(client); | ||
|
||
const result = await tablesDB.listTransactions({ | ||
queries: [] // optional | ||
}); | ||
|
||
console.log(result); |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -11,7 +11,8 @@ const result = await tablesDB.updateRow({ | |||||||||
tableId: '<TABLE_ID>', | ||||||||||
rowId: '<ROW_ID>', | ||||||||||
data: {}, // optional | ||||||||||
permissions: ["read("any")"] // optional | ||||||||||
permissions: ["read("any")"], // optional | ||||||||||
transactionId: '<TRANSACTION_ID>' // optional | ||||||||||
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix invalid permissions string literal.
- permissions: ["read("any")"], // optional
+ permissions: ['read("any")'], // optional 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||
}); | ||||||||||
|
||||||||||
console.log(result); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Client, TablesDB } from "react-native-appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
||
const tablesDB = new TablesDB(client); | ||
|
||
const result = await tablesDB.updateTransaction({ | ||
transactionId: '<TRANSACTION_ID>', | ||
commit: false, // optional | ||
rollback: false // optional | ||
}); | ||
|
||
console.log(result); |
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.📝 Committable suggestion
🤖 Prompt for AI Agents