This commit is contained in:
Jake Barnby
2025-09-13 02:42:42 +12:00
parent 5c09e8ae00
commit 0f9c2001f7
79 changed files with 474 additions and 82 deletions
+4 -4
View File
@@ -11,7 +11,7 @@ return [
[
'key' => 'web',
'name' => 'Web',
'version' => '20.0.0',
'version' => '20.1.0-rc.1',
'url' => 'https://github.com/appwrite/sdk-for-web',
'package' => 'https://www.npmjs.com/package/appwrite',
'enabled' => true,
@@ -24,7 +24,7 @@ return [
'gitUrl' => 'git@github.com:appwrite/sdk-for-web.git',
'gitRepoName' => 'sdk-for-web',
'gitUserName' => 'appwrite',
'gitBranch' => 'dev',
'gitBranch' => 'feat-txn',
'changelog' => \realpath(__DIR__ . '/../../docs/sdks/web/CHANGELOG.md'),
'demos' => [
[
@@ -262,7 +262,7 @@ return [
[
'key' => 'nodejs',
'name' => 'Node.js',
'version' => '19.0.0',
'version' => '19.1.0-rc.1',
'url' => 'https://github.com/appwrite/sdk-for-node',
'package' => 'https://www.npmjs.com/package/node-appwrite',
'enabled' => true,
@@ -275,7 +275,7 @@ return [
'gitUrl' => 'git@github.com:appwrite/sdk-for-node.git',
'gitRepoName' => 'sdk-for-node',
'gitUserName' => 'appwrite',
'gitBranch' => 'dev',
'gitBranch' => 'feat-txn',
'changelog' => \realpath(__DIR__ . '/../../docs/sdks/nodejs/CHANGELOG.md'),
],
[
+2 -2
View File
@@ -5143,7 +5143,7 @@
},
"\/databases\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "databasesCreateOperations",
"tags": [
"databases"
@@ -8285,7 +8285,7 @@
},
"\/tablesdb\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "tablesDBCreateOperations",
"tags": [
"tablesDB"
@@ -5542,7 +5542,7 @@
},
"\/databases\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "databasesCreateOperations",
"tags": [
"databases"
@@ -33677,7 +33677,7 @@
},
"\/tablesdb\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "tablesDBCreateOperations",
"tags": [
"tablesDB"
+2 -2
View File
@@ -5090,7 +5090,7 @@
},
"\/databases\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "databasesCreateOperations",
"tags": [
"databases"
@@ -24203,7 +24203,7 @@
},
"\/tablesdb\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "tablesDBCreateOperations",
"tags": [
"tablesDB"
@@ -5143,7 +5143,7 @@
},
"\/databases\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "databasesCreateOperations",
"tags": [
"databases"
@@ -5212,7 +5212,7 @@
"operations": {
"type": "array",
"description": "Array of staged operations.",
"x-example": "[\n {\n \"action\": \"create\",\n \"databaseId\": \"<DATABASE_ID>\",\n \"collectionId\": \"<COLLECTION_ID>\",\n \"documentId\": \"<DOCUMENT_ID>\",\n \"data\": {\n \"name\": \"Walter O'Brien\"\n }\n }\n]",
"x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"<DATABASE_ID>\",\n\t \"collectionId\": \"<COLLECTION_ID>\",\n\t \"documentId\": \"<DOCUMENT_ID>\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]",
"items": {
"type": "object"
}
@@ -8285,7 +8285,7 @@
},
"\/tablesdb\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "tablesDBCreateOperations",
"tags": [
"tablesDB"
@@ -8354,7 +8354,7 @@
"operations": {
"type": "array",
"description": "Array of staged operations.",
"x-example": "[\n {\n \"action\": \"create\",\n \"databaseId\": \"<DATABASE_ID>\",\n \"tableId\": \"<TABLE_ID>\",\n \"rowId\": \"<ROW_ID>\",\n \"data\": {\n \"name\": \"Walter O'Brien\"\n }\n }\n]",
"x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"<DATABASE_ID>\",\n\t \"tableId\": \"<TABLE_ID>\",\n\t \"rowId\": \"<ROW_ID>\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]",
"items": {
"type": "object"
}
@@ -5542,7 +5542,7 @@
},
"\/databases\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "databasesCreateOperations",
"tags": [
"databases"
@@ -5611,7 +5611,7 @@
"operations": {
"type": "array",
"description": "Array of staged operations.",
"x-example": "[\n {\n \"action\": \"create\",\n \"databaseId\": \"<DATABASE_ID>\",\n \"collectionId\": \"<COLLECTION_ID>\",\n \"documentId\": \"<DOCUMENT_ID>\",\n \"data\": {\n \"name\": \"Walter O'Brien\"\n }\n }\n]",
"x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"<DATABASE_ID>\",\n\t \"collectionId\": \"<COLLECTION_ID>\",\n\t \"documentId\": \"<DOCUMENT_ID>\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]",
"items": {
"type": "object"
}
@@ -33677,7 +33677,7 @@
},
"\/tablesdb\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "tablesDBCreateOperations",
"tags": [
"tablesDB"
@@ -33746,7 +33746,7 @@
"operations": {
"type": "array",
"description": "Array of staged operations.",
"x-example": "[\n {\n \"action\": \"create\",\n \"databaseId\": \"<DATABASE_ID>\",\n \"tableId\": \"<TABLE_ID>\",\n \"rowId\": \"<ROW_ID>\",\n \"data\": {\n \"name\": \"Walter O'Brien\"\n }\n }\n]",
"x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"<DATABASE_ID>\",\n\t \"tableId\": \"<TABLE_ID>\",\n\t \"rowId\": \"<ROW_ID>\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]",
"items": {
"type": "object"
}
@@ -5090,7 +5090,7 @@
},
"\/databases\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "databasesCreateOperations",
"tags": [
"databases"
@@ -5161,7 +5161,7 @@
"operations": {
"type": "array",
"description": "Array of staged operations.",
"x-example": "[\n {\n \"action\": \"create\",\n \"databaseId\": \"<DATABASE_ID>\",\n \"collectionId\": \"<COLLECTION_ID>\",\n \"documentId\": \"<DOCUMENT_ID>\",\n \"data\": {\n \"name\": \"Walter O'Brien\"\n }\n }\n]",
"x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"<DATABASE_ID>\",\n\t \"collectionId\": \"<COLLECTION_ID>\",\n\t \"documentId\": \"<DOCUMENT_ID>\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]",
"items": {
"type": "object"
}
@@ -24203,7 +24203,7 @@
},
"\/tablesdb\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "tablesDBCreateOperations",
"tags": [
"tablesDB"
@@ -24274,7 +24274,7 @@
"operations": {
"type": "array",
"description": "Array of staged operations.",
"x-example": "[\n {\n \"action\": \"create\",\n \"databaseId\": \"<DATABASE_ID>\",\n \"tableId\": \"<TABLE_ID>\",\n \"rowId\": \"<ROW_ID>\",\n \"data\": {\n \"name\": \"Walter O'Brien\"\n }\n }\n]",
"x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"<DATABASE_ID>\",\n\t \"tableId\": \"<TABLE_ID>\",\n\t \"rowId\": \"<ROW_ID>\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]",
"items": {
"type": "object"
}
+2 -2
View File
@@ -5282,7 +5282,7 @@
},
"\/databases\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "databasesCreateOperations",
"consumes": [
"application\/json"
@@ -8359,7 +8359,7 @@
},
"\/tablesdb\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "tablesDBCreateOperations",
"consumes": [
"application\/json"
+2 -2
View File
@@ -5701,7 +5701,7 @@
},
"\/databases\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "databasesCreateOperations",
"consumes": [
"application\/json"
@@ -33793,7 +33793,7 @@
},
"\/tablesdb\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "tablesDBCreateOperations",
"consumes": [
"application\/json"
+2 -2
View File
@@ -5237,7 +5237,7 @@
},
"\/databases\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "databasesCreateOperations",
"consumes": [
"application\/json"
@@ -24375,7 +24375,7 @@
},
"\/tablesdb\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "tablesDBCreateOperations",
"consumes": [
"application\/json"
+4 -4
View File
@@ -5282,7 +5282,7 @@
},
"\/databases\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "databasesCreateOperations",
"consumes": [
"application\/json"
@@ -5350,7 +5350,7 @@
"type": "array",
"description": "Array of staged operations.",
"default": [],
"x-example": "[\n {\n \"action\": \"create\",\n \"databaseId\": \"<DATABASE_ID>\",\n \"collectionId\": \"<COLLECTION_ID>\",\n \"documentId\": \"<DOCUMENT_ID>\",\n \"data\": {\n \"name\": \"Walter O'Brien\"\n }\n }\n]",
"x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"<DATABASE_ID>\",\n\t \"collectionId\": \"<COLLECTION_ID>\",\n\t \"documentId\": \"<DOCUMENT_ID>\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]",
"items": {
"type": "object"
}
@@ -8359,7 +8359,7 @@
},
"\/tablesdb\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "tablesDBCreateOperations",
"consumes": [
"application\/json"
@@ -8427,7 +8427,7 @@
"type": "array",
"description": "Array of staged operations.",
"default": [],
"x-example": "[\n {\n \"action\": \"create\",\n \"databaseId\": \"<DATABASE_ID>\",\n \"tableId\": \"<TABLE_ID>\",\n \"rowId\": \"<ROW_ID>\",\n \"data\": {\n \"name\": \"Walter O'Brien\"\n }\n }\n]",
"x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"<DATABASE_ID>\",\n\t \"tableId\": \"<TABLE_ID>\",\n\t \"rowId\": \"<ROW_ID>\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]",
"items": {
"type": "object"
}
@@ -5701,7 +5701,7 @@
},
"\/databases\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "databasesCreateOperations",
"consumes": [
"application\/json"
@@ -5769,7 +5769,7 @@
"type": "array",
"description": "Array of staged operations.",
"default": [],
"x-example": "[\n {\n \"action\": \"create\",\n \"databaseId\": \"<DATABASE_ID>\",\n \"collectionId\": \"<COLLECTION_ID>\",\n \"documentId\": \"<DOCUMENT_ID>\",\n \"data\": {\n \"name\": \"Walter O'Brien\"\n }\n }\n]",
"x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"<DATABASE_ID>\",\n\t \"collectionId\": \"<COLLECTION_ID>\",\n\t \"documentId\": \"<DOCUMENT_ID>\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]",
"items": {
"type": "object"
}
@@ -33793,7 +33793,7 @@
},
"\/tablesdb\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "tablesDBCreateOperations",
"consumes": [
"application\/json"
@@ -33861,7 +33861,7 @@
"type": "array",
"description": "Array of staged operations.",
"default": [],
"x-example": "[\n {\n \"action\": \"create\",\n \"databaseId\": \"<DATABASE_ID>\",\n \"tableId\": \"<TABLE_ID>\",\n \"rowId\": \"<ROW_ID>\",\n \"data\": {\n \"name\": \"Walter O'Brien\"\n }\n }\n]",
"x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"<DATABASE_ID>\",\n\t \"tableId\": \"<TABLE_ID>\",\n\t \"rowId\": \"<ROW_ID>\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]",
"items": {
"type": "object"
}
+4 -4
View File
@@ -5237,7 +5237,7 @@
},
"\/databases\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "databasesCreateOperations",
"consumes": [
"application\/json"
@@ -5307,7 +5307,7 @@
"type": "array",
"description": "Array of staged operations.",
"default": [],
"x-example": "[\n {\n \"action\": \"create\",\n \"databaseId\": \"<DATABASE_ID>\",\n \"collectionId\": \"<COLLECTION_ID>\",\n \"documentId\": \"<DOCUMENT_ID>\",\n \"data\": {\n \"name\": \"Walter O'Brien\"\n }\n }\n]",
"x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"<DATABASE_ID>\",\n\t \"collectionId\": \"<COLLECTION_ID>\",\n\t \"documentId\": \"<DOCUMENT_ID>\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]",
"items": {
"type": "object"
}
@@ -24375,7 +24375,7 @@
},
"\/tablesdb\/transactions\/{transactionId}\/operations": {
"post": {
"summary": "Add operations to transaction",
"summary": "Create operations scoped to a transaction",
"operationId": "tablesDBCreateOperations",
"consumes": [
"application\/json"
@@ -24445,7 +24445,7 @@
"type": "array",
"description": "Array of staged operations.",
"default": [],
"x-example": "[\n {\n \"action\": \"create\",\n \"databaseId\": \"<DATABASE_ID>\",\n \"tableId\": \"<TABLE_ID>\",\n \"rowId\": \"<ROW_ID>\",\n \"data\": {\n \"name\": \"Walter O'Brien\"\n }\n }\n]",
"x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"<DATABASE_ID>\",\n\t \"tableId\": \"<TABLE_ID>\",\n\t \"rowId\": \"<ROW_ID>\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]",
"items": {
"type": "object"
}
@@ -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
});
console.log(result);
@@ -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
});
console.log(result);
@@ -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);
@@ -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
});
console.log(result);
@@ -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);
@@ -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);
@@ -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
});
console.log(result);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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
});
console.log(result);
@@ -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);
@@ -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
});
console.log(result);
@@ -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);
@@ -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
});
console.log(result);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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
});
console.log(result);
@@ -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);
@@ -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);
@@ -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
});
console.log(result);
@@ -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);
@@ -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
});
console.log(result);
@@ -18,5 +18,6 @@ const result = await databases.createDocument({
"age": 30,
"isAdmin": false
},
permissions: ["read("any")"] // optional
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -10,5 +10,6 @@ const databases = new sdk.Databases(client);
const result = await databases.createDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documents: []
documents: [],
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -0,0 +1,23 @@
const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new sdk.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
});
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new sdk.Databases(client);
const result = await databases.createTransaction({
ttl: 60 // optional
});
@@ -13,5 +13,6 @@ const result = await databases.decrementDocumentAttribute({
documentId: '<DOCUMENT_ID>',
attribute: '',
value: null, // optional
min: null // optional
min: null, // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -10,5 +10,6 @@ const databases = new sdk.Databases(client);
const result = await databases.deleteDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>'
documentId: '<DOCUMENT_ID>',
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -10,5 +10,6 @@ const databases = new sdk.Databases(client);
const result = await databases.deleteDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [] // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new sdk.Databases(client);
const result = await databases.deleteTransaction({
transactionId: '<TRANSACTION_ID>'
});
@@ -11,5 +11,6 @@ const result = await databases.getDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
queries: [] // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new sdk.Databases(client);
const result = await databases.getTransaction({
transactionId: '<TRANSACTION_ID>'
});
@@ -13,5 +13,6 @@ const result = await databases.incrementDocumentAttribute({
documentId: '<DOCUMENT_ID>',
attribute: '',
value: null, // optional
max: null // optional
max: null, // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -10,5 +10,6 @@ const databases = new sdk.Databases(client);
const result = await databases.listDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [] // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new sdk.Databases(client);
const result = await databases.listTransactions({
queries: [] // optional
});
@@ -12,5 +12,6 @@ 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
});
@@ -11,5 +11,6 @@ const result = await databases.updateDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
data: {}, // optional
queries: [] // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -0,0 +1,14 @@
const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new sdk.Databases(client);
const result = await databases.updateTransaction({
transactionId: '<TRANSACTION_ID>',
commit: false, // optional
rollback: false // optional
});
@@ -12,5 +12,6 @@ const result = await databases.upsertDocument({
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {},
permissions: ["read("any")"] // optional
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -10,5 +10,6 @@ const databases = new sdk.Databases(client);
const result = await databases.upsertDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documents: []
documents: [],
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -16,7 +16,7 @@ const result = await messaging.createPush({
targets: [], // optional
data: {}, // optional
action: '<ACTION>', // optional
image: '[ID1:ID2]', // optional
image: '<ID1:ID2>', // optional
icon: '<ICON>', // optional
sound: '<SOUND>', // optional
color: '<COLOR>', // optional
@@ -16,7 +16,7 @@ const result = await messaging.updatePush({
body: '<BODY>', // optional
data: {}, // optional
action: '<ACTION>', // optional
image: '[ID1:ID2]', // optional
image: '<ID1:ID2>', // optional
icon: '<ICON>', // optional
sound: '<SOUND>', // optional
color: '<COLOR>', // optional
@@ -0,0 +1,23 @@
const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const tablesDB = new sdk.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
});
@@ -18,5 +18,6 @@ const result = await tablesDB.createRow({
"age": 30,
"isAdmin": false
},
permissions: ["read("any")"] // optional
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -10,5 +10,6 @@ const tablesDB = new sdk.TablesDB(client);
const result = await tablesDB.createRows({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rows: []
rows: [],
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const tablesDB = new sdk.TablesDB(client);
const result = await tablesDB.createTransaction({
ttl: 60 // optional
});
@@ -13,5 +13,6 @@ const result = await tablesDB.decrementRowColumn({
rowId: '<ROW_ID>',
column: '',
value: null, // optional
min: null // optional
min: null, // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -10,5 +10,6 @@ const tablesDB = new sdk.TablesDB(client);
const result = await tablesDB.deleteRow({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>'
rowId: '<ROW_ID>',
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -10,5 +10,6 @@ const tablesDB = new sdk.TablesDB(client);
const result = await tablesDB.deleteRows({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
queries: [] // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const tablesDB = new sdk.TablesDB(client);
const result = await tablesDB.deleteTransaction({
transactionId: '<TRANSACTION_ID>'
});
@@ -11,5 +11,6 @@ const result = await tablesDB.getRow({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
queries: [] // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const tablesDB = new sdk.TablesDB(client);
const result = await tablesDB.getTransaction({
transactionId: '<TRANSACTION_ID>'
});
@@ -13,5 +13,6 @@ const result = await tablesDB.incrementRowColumn({
rowId: '<ROW_ID>',
column: '',
value: null, // optional
max: null // optional
max: null, // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -10,5 +10,6 @@ const tablesDB = new sdk.TablesDB(client);
const result = await tablesDB.listRows({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
queries: [] // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const tablesDB = new sdk.TablesDB(client);
const result = await tablesDB.listTransactions({
queries: [] // optional
});
@@ -12,5 +12,6 @@ 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
});
@@ -11,5 +11,6 @@ const result = await tablesDB.updateRows({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
data: {}, // optional
queries: [] // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
@@ -0,0 +1,14 @@
const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const tablesDB = new sdk.TablesDB(client);
const result = await tablesDB.updateTransaction({
transactionId: '<TRANSACTION_ID>',
commit: false, // optional
rollback: false // optional
});
@@ -12,5 +12,6 @@ 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
});
@@ -10,5 +10,6 @@ const tablesDB = new sdk.TablesDB(client);
const result = await tablesDB.upsertRows({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rows: []
rows: [],
transactionId: '<TRANSACTION_ID>' // optional
});