Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { Client, Account } from "appwrite";
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:

```html
<script src="https://cdn.jsdelivr.net/npm/appwrite@20.0.0"></script>
<script src="https://cdn.jsdelivr.net/npm/appwrite@20.1.0-rc.1"></script>
```


Expand Down
3 changes: 2 additions & 1 deletion docs/examples/databases/create-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const result = await databases.createDocument({
"age": 30,
"isAdmin": false
},
permissions: ["read("any")"] // optional
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
Comment on lines +20 to +21
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix invalid string quoting in permissions example.

Nested double quotes break the string. Use single quotes outside.

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.

Suggested change
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 example uses nested double quotes ("read("any")") which breaks the
string; change the outer quotes to single quotes so the line reads permissions:
['read("any")'] (leave transactionId as-is) to fix the invalid string quoting.

});

console.log(result);
24 changes: 24 additions & 0 deletions docs/examples/databases/create-operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Client, Databases } from "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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

operations is required; drop the “optional” comment.

Marking the operations array as optional is inaccurate for this endpoint.

Apply this diff:

-    ] // 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.

Suggested change
] // optional
]
🤖 Prompt for AI Agents
In docs/examples/databases/create-operations.md around line 21, the operations
array is incorrectly annotated as optional; remove the "optional" comment and
any wording suggesting it's optional so the documentation clearly states that
the operations array is required for this endpoint. Ensure the line now reflects
that operations must be provided (e.g., delete the " // optional" suffix and
update surrounding text if necessary to avoid implying optionality).

});

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/databases/create-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Databases } from "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);
3 changes: 2 additions & 1 deletion docs/examples/databases/decrement-document-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const result = await databases.decrementDocumentAttribute({
documentId: '<DOCUMENT_ID>',
attribute: '',
value: null, // optional
min: null // optional
min: null, // optional
transactionId: '<TRANSACTION_ID>' // optional
Comment on lines 14 to +16
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use concrete numbers or omit fields instead of null for numeric options.

As above, null can be invalid for numeric parameters. Provide a typical value or remove the field.

-    value: null, // optional
-    min: null, // optional
+    value: 1, // optional; omit to use default decrement
+    // min: 0, // optional; omit if not bounding
📝 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.

Suggested change
value: null, // optional
min: null // optional
min: null, // optional
transactionId: '<TRANSACTION_ID>' // optional
value: 1, // optional; omit to use default decrement
// min: 0, // optional; omit if not bounding
transactionId: '<TRANSACTION_ID>' // optional
🤖 Prompt for AI Agents
In docs/examples/databases/decrement-document-attribute.md around lines 14 to
16, the example sets numeric options to null which can be invalid; replace null
with concrete numeric examples (e.g., a decrement value and a minimum like 0) or
remove the optional numeric fields entirely, and for transactionId either omit
it or show a realistic placeholder string if needed for the example.

});

console.log(result);
3 changes: 2 additions & 1 deletion docs/examples/databases/delete-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const databases = new Databases(client);
const result = await databases.deleteDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>'
documentId: '<DOCUMENT_ID>',
transactionId: '<TRANSACTION_ID>' // optional
});

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/databases/delete-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Databases } from "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);
3 changes: 2 additions & 1 deletion docs/examples/databases/get-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const result = await databases.getDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
queries: [] // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
Comment on lines +13 to +14
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove unsupported queries from getDocument example.

getDocument doesn’t accept a queries array; including it is misleading documentation.

Apply this diff:

-    queries: [], // optional
     transactionId: '<TRANSACTION_ID>' // 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.

Suggested change
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
transactionId: '<TRANSACTION_ID>' // optional
🤖 Prompt for AI Agents
In docs/examples/databases/get-document.md around lines 13 to 14, the example
includes an unsupported queries: [] parameter for getDocument; remove the
queries line entirely and leave only supported options (e.g., transactionId if
needed) so the example reflects the actual API signature.

});

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/databases/get-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Databases } from "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);
3 changes: 2 additions & 1 deletion docs/examples/databases/increment-document-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const result = await databases.incrementDocumentAttribute({
documentId: '<DOCUMENT_ID>',
attribute: '',
value: null, // optional
max: null // optional
max: null, // optional
transactionId: '<TRANSACTION_ID>' // optional
});

console.log(result);
3 changes: 2 additions & 1 deletion docs/examples/databases/list-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const databases = new Databases(client);
const result = await databases.listDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [] // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
});

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/databases/list-transactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Databases } from "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);
3 changes: 2 additions & 1 deletion docs/examples/databases/update-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const result = await databases.updateDocument({
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {}, // optional
permissions: ["read("any")"] // optional
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
Comment on lines +14 to +15
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix invalid string quoting in permissions example.

Nested double quotes break the string. Use single quotes outside.

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.

Suggested change
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
permissions: ['read("any")'], // optional
transactionId: '<TRANSACTION_ID>' // optional
🤖 Prompt for AI Agents
In docs/examples/databases/update-document.md around lines 14-15, the
permissions example uses double quotes outside and also around the inner
argument (read("any")), which breaks the string; change the permissions array
entry to use single quotes outside so it reads permissions: ['read("any")'] and
keep the transactionId line as-is.

});

console.log(result);
15 changes: 15 additions & 0 deletions docs/examples/databases/update-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Client, Databases } from "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);
3 changes: 2 additions & 1 deletion docs/examples/databases/upsert-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 16
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix invalid string quoting in permissions example.
Current snippet won’t parse due to nested quotes.

-    permissions: ["read("any")"], // optional
+    permissions: ['read("any")'], // optional
     transactionId: '<TRANSACTION_ID>' // optional

Optional (clearer, typed):

// permissions: [Permission.read(Role.any())]
🤖 Prompt for AI Agents
In docs/examples/databases/upsert-document.md around lines 14-16 the permissions
example uses invalid nested quotes ("read("any")") which will not parse; replace
that string with a properly quoted value (e.g. escape the inner quotes) or,
preferably, use the clearer typed form Permission.read(Role.any()) as shown in
the suggestion, so the example parses and is unambiguous.


console.log(result);
24 changes: 24 additions & 0 deletions docs/examples/tablesdb/create-operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Client, TablesDB } from "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);
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/create-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix invalid string quoting in permissions example.
Same quoting issue as databases snippet.

-    permissions: ["read("any")"], // optional
+    permissions: ['read("any")'], // optional
     transactionId: '<TRANSACTION_ID>' // optional

Optional (typed helpers):

// permissions: [Permission.read(Role.any())]
🤖 Prompt for AI Agents
In docs/examples/tablesdb/create-row.md around lines 20 to 22, the permissions
example uses nested double quotes causing invalid JS string syntax; change the
permissions array element to use single quotes outside so the inner double
quotes remain valid (e.g., permissions: ['read("any")']), or alternatively use
the typed helper example shown in the comment (Permission.read(Role.any())).


console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/tablesdb/create-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, TablesDB } from "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);
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/decrement-row-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const result = await tablesDB.decrementRowColumn({
rowId: '<ROW_ID>',
column: '',
value: null, // optional
min: null // optional
min: null, // optional
transactionId: '<TRANSACTION_ID>' // optional
});

console.log(result);
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/delete-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const tablesDB = new TablesDB(client);
const result = await tablesDB.deleteRow({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>'
rowId: '<ROW_ID>',
transactionId: '<TRANSACTION_ID>' // optional
});

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/tablesdb/delete-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, TablesDB } from "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);
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/get-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const result = await tablesDB.getRow({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
queries: [] // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
});

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/tablesdb/get-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, TablesDB } from "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);
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/increment-row-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const result = await tablesDB.incrementRowColumn({
rowId: '<ROW_ID>',
column: '',
value: null, // optional
max: null // optional
max: null, // optional
transactionId: '<TRANSACTION_ID>' // optional
});
Comment on lines 13 to 17
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid sending null for optional numeric parameters; provide a concrete example value or omit the field.

APIs commonly reject null for numeric fields. Use a value (e.g., 1) or remove the property entirely if you want defaults. Also give the column a realistic placeholder.

-    column: '',
-    value: null, // optional
-    max: null, // optional
+    column: '<COLUMN_NAME>',
+    value: 1, // optional; omit to use default increment
+    // max: 100, // optional; omit if not capping
     transactionId: '<TRANSACTION_ID>' // 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.

Suggested change
column: '',
value: null, // optional
max: null // optional
max: null, // optional
transactionId: '<TRANSACTION_ID>' // optional
});
column: '<COLUMN_NAME>',
value: 1, // optional; omit to use default increment
// max: 100, // optional; omit if not capping
transactionId: '<TRANSACTION_ID>' // optional
});
🤖 Prompt for AI Agents
In docs/examples/tablesdb/increment-row-column.md around lines 13 to 17, the
example uses null for optional numeric fields and an empty string for column;
replace the empty column with a realistic placeholder (e.g., 'count' or
'visits') and either provide a concrete numeric value (e.g., 1) for max/value or
omit those properties entirely so the snippet shows valid, non-null values that
won't be rejected by APIs.


console.log(result);
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/list-rows.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const tablesDB = new TablesDB(client);
const result = await tablesDB.listRows({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
queries: [] // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
});

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/tablesdb/list-transactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, TablesDB } from "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);
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/update-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix invalid string quoting in permissions example.

Nested double quotes break the string. Use single quotes outside.

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.

Suggested change
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 permissions
example uses nested double quotes which break the string; change the outer
quotes to single quotes so the inner double quotes remain valid (e.g.,
permissions: ['read("any")']), ensuring the string is properly quoted and
remains a valid literal.

});

console.log(result);
15 changes: 15 additions & 0 deletions docs/examples/tablesdb/update-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Client, TablesDB } from "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);
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/upsert-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const result = await tablesDB.upsertRow({
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix invalid permissions syntax; use Permission/Role helpers.

["read("any")"] is syntactically invalid (nested quotes) and likely not accepted by the SDK. Use the helpers instead.

Apply within the changed lines:

-    permissions: ["read("any")"], // optional
+    permissions: [Permission.read(Role.any())], // optional

Also add the necessary imports at the top of this file (outside the changed range):

-import { Client, TablesDB } from "appwrite";
+import { Client, TablesDB, Permission, Role } from "appwrite";
📝 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.

Suggested change
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
import { Client, TablesDB, Permission, Role } from "appwrite";
Suggested change
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>' // optional
🤖 Prompt for AI Agents
In docs/examples/tablesdb/upsert-row.md around lines 14 to 15, the permissions
value uses invalid string syntax ["read("any")"]; replace it with the SDK
permission/role helper (e.g., Permission.read("any") or Role.read("any") per
your SDK) and pass that helper result (or an array of helpers) as the
permissions field, and also add the corresponding import statement(s) at the top
of the file (outside the changed range) for Permission/Role so the example
compiles.

});

console.log(result);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "appwrite",
"homepage": "https://appwrite.io/support",
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
"version": "20.0.0",
"version": "20.1.0-rc.1",
"license": "BSD-3-Clause",
"main": "dist/cjs/sdk.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ class Client {
'x-sdk-name': 'Web',
'x-sdk-platform': 'client',
'x-sdk-language': 'web',
'x-sdk-version': '20.0.0',
'x-sdk-version': '20.1.0-rc.1',
'X-Appwrite-Response-Format': '1.8.0',
};

Expand Down
Loading