diff --git a/examples/2.0.x/client-android/java/documentsdb/create-document.md b/examples/2.0.x/client-android/java/documentsdb/create-document.md new file mode 100644 index 000000000..77f034d88 --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/create-document.md @@ -0,0 +1,39 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 30, + "isAdmin", false + ), // data + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/create-documents.md b/examples/2.0.x/client-android/java/documentsdb/create-documents.md new file mode 100644 index 000000000..c52433a2d --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/create-documents.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createDocuments( + "", // databaseId + "", // collectionId + List.of(), // documents + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/create-operations.md b/examples/2.0.x/client-android/java/documentsdb/create-operations.md new file mode 100644 index 000000000..961a5501d --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/create-operations.md @@ -0,0 +1,35 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createOperations( + "", // transactionId + List.of(Map.of( + "action", "create", + "databaseId", "", + "collectionId", "", + "documentId", "", + "data", Map.of( + "name", "Walter O'Brien" + ) + )), // operations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/create-transaction.md b/examples/2.0.x/client-android/java/documentsdb/create-transaction.md new file mode 100644 index 000000000..da91c5c8e --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/create-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createTransaction( + 60, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-android/java/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..f1853ac6d --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/decrement-document-attribute.md @@ -0,0 +1,32 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.decrementDocumentAttribute( + "", // databaseId + "", // collectionId + "", // documentId + "", // attribute + 1, // value (optional) + 0, // min (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/delete-document.md b/examples/2.0.x/client-android/java/documentsdb/delete-document.md new file mode 100644 index 000000000..247a63aac --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/delete-document.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteDocument( + "", // databaseId + "", // collectionId + "", // documentId + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/delete-transaction.md b/examples/2.0.x/client-android/java/documentsdb/delete-transaction.md new file mode 100644 index 000000000..0b0a76161 --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/delete-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/get-document.md b/examples/2.0.x/client-android/java/documentsdb/get-document.md new file mode 100644 index 000000000..7bd66e1ea --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/get-document.md @@ -0,0 +1,30 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.getDocument( + "", // databaseId + "", // collectionId + "", // documentId + List.of(), // queries (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/get-transaction.md b/examples/2.0.x/client-android/java/documentsdb/get-transaction.md new file mode 100644 index 000000000..12c42243e --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/get-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.getTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-android/java/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..fab214e96 --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/increment-document-attribute.md @@ -0,0 +1,32 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.incrementDocumentAttribute( + "", // databaseId + "", // collectionId + "", // documentId + "", // attribute + 1, // value (optional) + 100, // max (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/list-documents.md b/examples/2.0.x/client-android/java/documentsdb/list-documents.md new file mode 100644 index 000000000..0abb6734c --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/list-documents.md @@ -0,0 +1,31 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.listDocuments( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + "", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/list-transactions.md b/examples/2.0.x/client-android/java/documentsdb/list-transactions.md new file mode 100644 index 000000000..9b8fcd7bc --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/list-transactions.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.listTransactions( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/update-document.md b/examples/2.0.x/client-android/java/documentsdb/update-document.md new file mode 100644 index 000000000..da8475fa8 --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/update-document.md @@ -0,0 +1,33 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.updateDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/update-transaction.md b/examples/2.0.x/client-android/java/documentsdb/update-transaction.md new file mode 100644 index 000000000..9d95dfcd6 --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/update-transaction.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.updateTransaction( + "", // transactionId + false, // commit (optional) + false, // rollback (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/upsert-document.md b/examples/2.0.x/client-android/java/documentsdb/upsert-document.md new file mode 100644 index 000000000..82e90a403 --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/upsert-document.md @@ -0,0 +1,33 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.upsertDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/storage/get-file-preview.md b/examples/2.0.x/client-android/java/storage/get-file-preview.md index 023a76043..3d753c447 100644 --- a/examples/2.0.x/client-android/java/storage/get-file-preview.md +++ b/examples/2.0.x/client-android/java/storage/get-file-preview.md @@ -18,7 +18,7 @@ storage.getFilePreview( "", // fileId 0, // width (optional) 0, // height (optional) - ImageGravity.CENTER, // gravity (optional) + ImageGravity.AUTO, // gravity (optional) -1, // quality (optional) 0, // borderWidth (optional) "FFFFFF", // borderColor (optional) diff --git a/examples/2.0.x/client-android/java/vectorsdb/create-document.md b/examples/2.0.x/client-android/java/vectorsdb/create-document.md new file mode 100644 index 000000000..8a3d7f9eb --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/create-document.md @@ -0,0 +1,38 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of( + "embeddings", List.of(0.12, -0.55, 0.88, 1.02), + "metadata", Map.of( + "key", "value" + ) + ), // data + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/create-operations.md b/examples/2.0.x/client-android/java/vectorsdb/create-operations.md new file mode 100644 index 000000000..7e503634c --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/create-operations.md @@ -0,0 +1,35 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createOperations( + "", // transactionId + List.of(Map.of( + "action", "create", + "databaseId", "", + "collectionId", "", + "documentId", "", + "data", Map.of( + "name", "Walter O'Brien" + ) + )), // operations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/create-query.md b/examples/2.0.x/client-android/java/vectorsdb/create-query.md new file mode 100644 index 000000000..3f1cfd5cc --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/create-query.md @@ -0,0 +1,31 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createQuery( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + "", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/create-transaction.md b/examples/2.0.x/client-android/java/vectorsdb/create-transaction.md new file mode 100644 index 000000000..4784fc47c --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/create-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createTransaction( + 60, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/delete-document.md b/examples/2.0.x/client-android/java/vectorsdb/delete-document.md new file mode 100644 index 000000000..d80673015 --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/delete-document.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteDocument( + "", // databaseId + "", // collectionId + "", // documentId + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/delete-transaction.md b/examples/2.0.x/client-android/java/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..04b9c4da1 --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/delete-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/get-document.md b/examples/2.0.x/client-android/java/vectorsdb/get-document.md new file mode 100644 index 000000000..15ddf82d0 --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/get-document.md @@ -0,0 +1,30 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.getDocument( + "", // databaseId + "", // collectionId + "", // documentId + List.of(), // queries (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/get-transaction.md b/examples/2.0.x/client-android/java/vectorsdb/get-transaction.md new file mode 100644 index 000000000..987ca6e7c --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/get-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.getTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/list-documents.md b/examples/2.0.x/client-android/java/vectorsdb/list-documents.md new file mode 100644 index 000000000..12ef1f0c3 --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/list-documents.md @@ -0,0 +1,31 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.listDocuments( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + "", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/list-transactions.md b/examples/2.0.x/client-android/java/vectorsdb/list-transactions.md new file mode 100644 index 000000000..18ef0e55d --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/list-transactions.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.listTransactions( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/update-document.md b/examples/2.0.x/client-android/java/vectorsdb/update-document.md new file mode 100644 index 000000000..4acb5cce0 --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/update-document.md @@ -0,0 +1,33 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.updateDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/update-transaction.md b/examples/2.0.x/client-android/java/vectorsdb/update-transaction.md new file mode 100644 index 000000000..a21aad1aa --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/update-transaction.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.updateTransaction( + "", // transactionId + false, // commit (optional) + false, // rollback (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/upsert-document.md b/examples/2.0.x/client-android/java/vectorsdb/upsert-document.md new file mode 100644 index 000000000..58ac9a9a9 --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/upsert-document.md @@ -0,0 +1,33 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.upsertDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-session.md b/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-session.md index 554499812..cde941c78 100644 --- a/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-session.md +++ b/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-session.md @@ -10,7 +10,7 @@ val client = Client(context) val account = Account(client) -val result = account.createOAuth2Session( +account.createOAuth2Session( provider = OAuthProvider.AMAZON, success = "https://example.com", // (optional) failure = "https://example.com", // (optional) diff --git a/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-token.md b/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-token.md index 3baa37dd1..5e9056494 100644 --- a/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-token.md +++ b/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-token.md @@ -10,7 +10,7 @@ val client = Client(context) val account = Account(client) -val result = account.createOAuth2Token( +account.createOAuth2Token( provider = OAuthProvider.AMAZON, success = "https://example.com", // (optional) failure = "https://example.com", // (optional) diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/create-document.md b/examples/2.0.x/client-android/kotlin/documentsdb/create-document.md new file mode 100644 index 000000000..e2e493f86 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/create-document.md @@ -0,0 +1,28 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.createDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/create-documents.md b/examples/2.0.x/client-android/kotlin/documentsdb/create-documents.md new file mode 100644 index 000000000..2923c1007 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/create-documents.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.createDocuments( + databaseId = "", + collectionId = "", + documents = listOf(), + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/create-operations.md b/examples/2.0.x/client-android/kotlin/documentsdb/create-operations.md new file mode 100644 index 000000000..c62580959 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/create-operations.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.createOperations( + transactionId = "", + operations = listOf(mapOf( + "action" to "create", + "databaseId" to "", + "collectionId" to "", + "documentId" to "", + "data" to mapOf( + "name" to "Walter O'Brien" + ) + )), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/create-transaction.md b/examples/2.0.x/client-android/kotlin/documentsdb/create-transaction.md new file mode 100644 index 000000000..ad1f0b217 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/create-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.createTransaction( + ttl = 60, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-android/kotlin/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..fdb11fe06 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.decrementDocumentAttribute( + databaseId = "", + collectionId = "", + documentId = "", + attribute = "", + value = 1, // (optional) + min = 0, // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/delete-document.md b/examples/2.0.x/client-android/kotlin/documentsdb/delete-document.md new file mode 100644 index 000000000..648a83ca4 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/delete-document.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.deleteDocument( + databaseId = "", + collectionId = "", + documentId = "", + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/delete-transaction.md b/examples/2.0.x/client-android/kotlin/documentsdb/delete-transaction.md new file mode 100644 index 000000000..d991466f1 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.deleteTransaction( + transactionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/get-document.md b/examples/2.0.x/client-android/kotlin/documentsdb/get-document.md new file mode 100644 index 000000000..1988e0028 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/get-document.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.getDocument( + databaseId = "", + collectionId = "", + documentId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/get-transaction.md b/examples/2.0.x/client-android/kotlin/documentsdb/get-transaction.md new file mode 100644 index 000000000..695412e77 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/get-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.getTransaction( + transactionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-android/kotlin/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..8286ad447 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/increment-document-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.incrementDocumentAttribute( + databaseId = "", + collectionId = "", + documentId = "", + attribute = "", + value = 1, // (optional) + max = 100, // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/list-documents.md b/examples/2.0.x/client-android/kotlin/documentsdb/list-documents.md new file mode 100644 index 000000000..a8c1b66b7 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/list-documents.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.listDocuments( + databaseId = "", + collectionId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) + total = false, // (optional) + ttl = 0, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/list-transactions.md b/examples/2.0.x/client-android/kotlin/documentsdb/list-transactions.md new file mode 100644 index 000000000..46571468e --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/list-transactions.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.listTransactions( + queries = listOf(), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/update-document.md b/examples/2.0.x/client-android/kotlin/documentsdb/update-document.md new file mode 100644 index 000000000..69668863d --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/update-document.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.updateDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/update-transaction.md b/examples/2.0.x/client-android/kotlin/documentsdb/update-transaction.md new file mode 100644 index 000000000..78fb3e7b9 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/update-transaction.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.updateTransaction( + transactionId = "", + commit = false, // (optional) + rollback = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/upsert-document.md b/examples/2.0.x/client-android/kotlin/documentsdb/upsert-document.md new file mode 100644 index 000000000..defc50a20 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/upsert-document.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.upsertDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/storage/get-file-preview.md b/examples/2.0.x/client-android/kotlin/storage/get-file-preview.md index aa83fe6e8..e2d2851d7 100644 --- a/examples/2.0.x/client-android/kotlin/storage/get-file-preview.md +++ b/examples/2.0.x/client-android/kotlin/storage/get-file-preview.md @@ -16,7 +16,7 @@ val result = storage.getFilePreview( fileId = "", width = 0, // (optional) height = 0, // (optional) - gravity = ImageGravity.CENTER, // (optional) + gravity = ImageGravity.AUTO, // (optional) quality = -1, // (optional) borderWidth = 0, // (optional) borderColor = "FFFFFF", // (optional) diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/create-document.md b/examples/2.0.x/client-android/kotlin/vectorsdb/create-document.md new file mode 100644 index 000000000..960654faa --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/create-document.md @@ -0,0 +1,27 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.createDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( + "embeddings" to listOf(0.12, -0.55, 0.88, 1.02), + "metadata" to mapOf( + "key" to "value" + ) + ), + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/create-operations.md b/examples/2.0.x/client-android/kotlin/vectorsdb/create-operations.md new file mode 100644 index 000000000..1a2908af9 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/create-operations.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.createOperations( + transactionId = "", + operations = listOf(mapOf( + "action" to "create", + "databaseId" to "", + "collectionId" to "", + "documentId" to "", + "data" to mapOf( + "name" to "Walter O'Brien" + ) + )), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/create-query.md b/examples/2.0.x/client-android/kotlin/vectorsdb/create-query.md new file mode 100644 index 000000000..0e8aaf25e --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/create-query.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.createQuery( + databaseId = "", + collectionId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) + total = false, // (optional) + ttl = 0, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/create-transaction.md b/examples/2.0.x/client-android/kotlin/vectorsdb/create-transaction.md new file mode 100644 index 000000000..9ca3de5ce --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/create-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.createTransaction( + ttl = 60, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/delete-document.md b/examples/2.0.x/client-android/kotlin/vectorsdb/delete-document.md new file mode 100644 index 000000000..9cc1856f2 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/delete-document.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.deleteDocument( + databaseId = "", + collectionId = "", + documentId = "", + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/delete-transaction.md b/examples/2.0.x/client-android/kotlin/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..e97ab53a8 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.deleteTransaction( + transactionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/get-document.md b/examples/2.0.x/client-android/kotlin/vectorsdb/get-document.md new file mode 100644 index 000000000..22584ab1a --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/get-document.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.getDocument( + databaseId = "", + collectionId = "", + documentId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/get-transaction.md b/examples/2.0.x/client-android/kotlin/vectorsdb/get-transaction.md new file mode 100644 index 000000000..2a510ea86 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/get-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.getTransaction( + transactionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/list-documents.md b/examples/2.0.x/client-android/kotlin/vectorsdb/list-documents.md new file mode 100644 index 000000000..90a7f04a3 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/list-documents.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.listDocuments( + databaseId = "", + collectionId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) + total = false, // (optional) + ttl = 0, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/list-transactions.md b/examples/2.0.x/client-android/kotlin/vectorsdb/list-transactions.md new file mode 100644 index 000000000..97981c01a --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/list-transactions.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.listTransactions( + queries = listOf(), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/update-document.md b/examples/2.0.x/client-android/kotlin/vectorsdb/update-document.md new file mode 100644 index 000000000..13422596c --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/update-document.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.updateDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/update-transaction.md b/examples/2.0.x/client-android/kotlin/vectorsdb/update-transaction.md new file mode 100644 index 000000000..c49da3486 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/update-transaction.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.updateTransaction( + transactionId = "", + commit = false, // (optional) + rollback = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/upsert-document.md b/examples/2.0.x/client-android/kotlin/vectorsdb/upsert-document.md new file mode 100644 index 000000000..111b61c6b --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/upsert-document.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.upsertDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-o-auth-2-session.md b/examples/2.0.x/client-apple/examples/account/create-o-auth-2-session.md index 29d817a93..3552fda80 100644 --- a/examples/2.0.x/client-apple/examples/account/create-o-auth-2-session.md +++ b/examples/2.0.x/client-apple/examples/account/create-o-auth-2-session.md @@ -8,7 +8,7 @@ let client = Client() let account = Account(client) -let result = try await account.createOAuth2Session( +let success = try await account.createOAuth2Session( provider: .amazon, success: "https://example.com", // optional failure: "https://example.com", // optional diff --git a/examples/2.0.x/client-apple/examples/account/create-o-auth-2-token.md b/examples/2.0.x/client-apple/examples/account/create-o-auth-2-token.md index 5e3f4358c..1a22fb32c 100644 --- a/examples/2.0.x/client-apple/examples/account/create-o-auth-2-token.md +++ b/examples/2.0.x/client-apple/examples/account/create-o-auth-2-token.md @@ -8,7 +8,7 @@ let client = Client() let account = Account(client) -let result = try await account.createOAuth2Token( +let success = try await account.createOAuth2Token( provider: .amazon, success: "https://example.com", // optional failure: "https://example.com", // optional diff --git a/examples/2.0.x/client-apple/examples/avatars/get-browser.md b/examples/2.0.x/client-apple/examples/avatars/get-browser.md index ccb1b3fae..9825d8804 100644 --- a/examples/2.0.x/client-apple/examples/avatars/get-browser.md +++ b/examples/2.0.x/client-apple/examples/avatars/get-browser.md @@ -8,7 +8,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getBrowser( +let bytes = try await avatars.getBrowser( code: .avantBrowser, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-apple/examples/avatars/get-credit-card.md b/examples/2.0.x/client-apple/examples/avatars/get-credit-card.md index 7871280e1..a294929a6 100644 --- a/examples/2.0.x/client-apple/examples/avatars/get-credit-card.md +++ b/examples/2.0.x/client-apple/examples/avatars/get-credit-card.md @@ -8,7 +8,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getCreditCard( +let bytes = try await avatars.getCreditCard( code: .americanExpress, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-apple/examples/avatars/get-favicon.md b/examples/2.0.x/client-apple/examples/avatars/get-favicon.md index c68b7e01a..0d5435214 100644 --- a/examples/2.0.x/client-apple/examples/avatars/get-favicon.md +++ b/examples/2.0.x/client-apple/examples/avatars/get-favicon.md @@ -7,7 +7,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getFavicon( +let bytes = try await avatars.getFavicon( url: "https://example.com" ) diff --git a/examples/2.0.x/client-apple/examples/avatars/get-flag.md b/examples/2.0.x/client-apple/examples/avatars/get-flag.md index 4ff35acbe..ae4586067 100644 --- a/examples/2.0.x/client-apple/examples/avatars/get-flag.md +++ b/examples/2.0.x/client-apple/examples/avatars/get-flag.md @@ -8,7 +8,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getFlag( +let bytes = try await avatars.getFlag( code: .afghanistan, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-apple/examples/avatars/get-image.md b/examples/2.0.x/client-apple/examples/avatars/get-image.md index ecad58395..0cbc666ae 100644 --- a/examples/2.0.x/client-apple/examples/avatars/get-image.md +++ b/examples/2.0.x/client-apple/examples/avatars/get-image.md @@ -7,7 +7,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getImage( +let bytes = try await avatars.getImage( url: "https://example.com", width: 0, // optional height: 0 // optional diff --git a/examples/2.0.x/client-apple/examples/avatars/get-initials.md b/examples/2.0.x/client-apple/examples/avatars/get-initials.md index 46507cf39..44fca8f30 100644 --- a/examples/2.0.x/client-apple/examples/avatars/get-initials.md +++ b/examples/2.0.x/client-apple/examples/avatars/get-initials.md @@ -7,7 +7,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getInitials( +let bytes = try await avatars.getInitials( name: "", // optional width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-apple/examples/avatars/get-photo.md b/examples/2.0.x/client-apple/examples/avatars/get-photo.md index 18b2b7064..d5a198275 100644 --- a/examples/2.0.x/client-apple/examples/avatars/get-photo.md +++ b/examples/2.0.x/client-apple/examples/avatars/get-photo.md @@ -7,7 +7,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getPhoto( +let bytes = try await avatars.getPhoto( width: 0, // optional height: 0, // optional quality: 0, // optional diff --git a/examples/2.0.x/client-apple/examples/avatars/get-qr.md b/examples/2.0.x/client-apple/examples/avatars/get-qr.md index 41edbdb68..86a43fba1 100644 --- a/examples/2.0.x/client-apple/examples/avatars/get-qr.md +++ b/examples/2.0.x/client-apple/examples/avatars/get-qr.md @@ -7,7 +7,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getQR( +let bytes = try await avatars.getQR( text: "", size: 1, // optional margin: 0, // optional diff --git a/examples/2.0.x/client-apple/examples/avatars/get-screenshot.md b/examples/2.0.x/client-apple/examples/avatars/get-screenshot.md index c727f8830..7711677f4 100644 --- a/examples/2.0.x/client-apple/examples/avatars/get-screenshot.md +++ b/examples/2.0.x/client-apple/examples/avatars/get-screenshot.md @@ -8,7 +8,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getScreenshot( +let bytes = try await avatars.getScreenshot( url: "https://example.com", headers: [ "Authorization": "Bearer token123", diff --git a/examples/2.0.x/client-apple/examples/documentsdb/create-document.md b/examples/2.0.x/client-apple/examples/documentsdb/create-document.md new file mode 100644 index 000000000..a0d6a69bc --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/create-document.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.createDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/create-documents.md b/examples/2.0.x/client-apple/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..c170200b7 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/create-documents.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let documentList = try await documentsDB.createDocuments( + databaseId: "", + collectionId: "", + documents: [], + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/create-operations.md b/examples/2.0.x/client-apple/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..c1bc948d3 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/create-operations.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let transaction = try await documentsDB.createOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/create-transaction.md b/examples/2.0.x/client-apple/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..88030b7de --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/create-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let transaction = try await documentsDB.createTransaction( + ttl: 60 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-apple/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..11d2ed3e1 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.decrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, // optional + min: 0, // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/delete-document.md b/examples/2.0.x/client-apple/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..10eef1736 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/delete-document.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let result = try await documentsDB.deleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/delete-transaction.md b/examples/2.0.x/client-apple/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..ca1c9bb19 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/delete-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let result = try await documentsDB.deleteTransaction( + transactionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/get-document.md b/examples/2.0.x/client-apple/examples/documentsdb/get-document.md new file mode 100644 index 000000000..504bbf1cc --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/get-document.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.getDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: [], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/get-transaction.md b/examples/2.0.x/client-apple/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..4435dce02 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/get-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let transaction = try await documentsDB.getTransaction( + transactionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-apple/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..41648951d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.incrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, // optional + max: 100, // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/list-documents.md b/examples/2.0.x/client-apple/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..81768bc19 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/list-documents.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let documentList = try await documentsDB.listDocuments( + databaseId: "", + collectionId: "", + queries: [], // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/list-transactions.md b/examples/2.0.x/client-apple/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..0fe1ca767 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/list-transactions.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let transactionList = try await documentsDB.listTransactions( + queries: [] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/update-document.md b/examples/2.0.x/client-apple/examples/documentsdb/update-document.md new file mode 100644 index 000000000..250ecd700 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/update-document.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.updateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [:], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/update-transaction.md b/examples/2.0.x/client-apple/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..1ea869b7c --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/update-transaction.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let transaction = try await documentsDB.updateTransaction( + transactionId: "", + commit: false, // optional + rollback: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/upsert-document.md b/examples/2.0.x/client-apple/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..cede61c6d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/upsert-document.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.upsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [:], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/storage/get-file-download.md b/examples/2.0.x/client-apple/examples/storage/get-file-download.md index 0809e2e48..c46d0723a 100644 --- a/examples/2.0.x/client-apple/examples/storage/get-file-download.md +++ b/examples/2.0.x/client-apple/examples/storage/get-file-download.md @@ -7,7 +7,7 @@ let client = Client() let storage = Storage(client) -let result = try await storage.getFileDownload( +let bytes = try await storage.getFileDownload( bucketId: "", fileId: "", token: "" // optional diff --git a/examples/2.0.x/client-apple/examples/storage/get-file-preview.md b/examples/2.0.x/client-apple/examples/storage/get-file-preview.md index 7414dedc9..ea1df78ad 100644 --- a/examples/2.0.x/client-apple/examples/storage/get-file-preview.md +++ b/examples/2.0.x/client-apple/examples/storage/get-file-preview.md @@ -8,12 +8,12 @@ let client = Client() let storage = Storage(client) -let result = try await storage.getFilePreview( +let bytes = try await storage.getFilePreview( bucketId: "", fileId: "", width: 0, // optional height: 0, // optional - gravity: .center, // optional + gravity: .auto, // optional quality: -1, // optional borderWidth: 0, // optional borderColor: "FFFFFF", // optional diff --git a/examples/2.0.x/client-apple/examples/storage/get-file-view.md b/examples/2.0.x/client-apple/examples/storage/get-file-view.md index f74e4c481..1364d8ef6 100644 --- a/examples/2.0.x/client-apple/examples/storage/get-file-view.md +++ b/examples/2.0.x/client-apple/examples/storage/get-file-view.md @@ -7,7 +7,7 @@ let client = Client() let storage = Storage(client) -let result = try await storage.getFileView( +let bytes = try await storage.getFileView( bucketId: "", fileId: "", token: "" // optional diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/create-document.md b/examples/2.0.x/client-apple/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..6676e3aa3 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/create-document.md @@ -0,0 +1,29 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let document = try await vectorsDB.createDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [ + "embeddings": [ + "0": 0.12, + "1": -0.55, + "2": 0.88, + "3": 1.02 + ], + "metadata": [ + "key": "value" + ] + ], + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/create-operations.md b/examples/2.0.x/client-apple/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..c90069aa2 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/create-operations.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let transaction = try await vectorsDB.createOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/create-query.md b/examples/2.0.x/client-apple/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..e80be9b2d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/create-query.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let documentList = try await vectorsDB.createQuery( + databaseId: "", + collectionId: "", + queries: [], // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/create-transaction.md b/examples/2.0.x/client-apple/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..4cdabc2ec --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/create-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let transaction = try await vectorsDB.createTransaction( + ttl: 60 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/delete-document.md b/examples/2.0.x/client-apple/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..dd80e834d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/delete-document.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let result = try await vectorsDB.deleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/client-apple/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..ff7538a06 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let result = try await vectorsDB.deleteTransaction( + transactionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/get-document.md b/examples/2.0.x/client-apple/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..e1814376f --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/get-document.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let document = try await vectorsDB.getDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: [], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/get-transaction.md b/examples/2.0.x/client-apple/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..4b8fd1a64 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/get-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let transaction = try await vectorsDB.getTransaction( + transactionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/list-documents.md b/examples/2.0.x/client-apple/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..c082c815e --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/list-documents.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let documentList = try await vectorsDB.listDocuments( + databaseId: "", + collectionId: "", + queries: [], // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/list-transactions.md b/examples/2.0.x/client-apple/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..26aa4f467 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/list-transactions.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let transactionList = try await vectorsDB.listTransactions( + queries: [] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/update-document.md b/examples/2.0.x/client-apple/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..f96706f84 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/update-document.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let document = try await vectorsDB.updateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [:], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/update-transaction.md b/examples/2.0.x/client-apple/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..f254540e5 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/update-transaction.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let transaction = try await vectorsDB.updateTransaction( + transactionId: "", + commit: false, // optional + rollback: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/upsert-document.md b/examples/2.0.x/client-apple/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..4fd857661 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/upsert-document.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let document = try await vectorsDB.upsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [:], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-session.md b/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-session.md index e2b59ae4f..75abae31a 100644 --- a/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-session.md +++ b/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-session.md @@ -8,7 +8,7 @@ Client client = Client() Account account = Account(client); - result = await account.createOAuth2Session( +await account.createOAuth2Session( provider: enums.OAuthProvider.amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional diff --git a/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-token.md b/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-token.md index 4e946f6fa..be098a627 100644 --- a/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-token.md +++ b/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-token.md @@ -8,7 +8,7 @@ Client client = Client() Account account = Account(client); - result = await account.createOAuth2Token( +await account.createOAuth2Token( provider: enums.OAuthProvider.amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-browser.md b/examples/2.0.x/client-flutter/examples/avatars/get-browser.md index 66745e0b4..91cd7be6e 100644 --- a/examples/2.0.x/client-flutter/examples/avatars/get-browser.md +++ b/examples/2.0.x/client-flutter/examples/avatars/get-browser.md @@ -1,4 +1,7 @@ ```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; import 'package:appwrite/enums.dart' as enums; @@ -8,10 +11,29 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getBrowser( +// Downloading file +Uint8List bytes = await avatars.getBrowser( code: enums.Browser.avantBrowser, width: 0, // optional height: 0, // optional quality: -1, // optional ); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getBrowser( + code: enums.Browser.avantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1, // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); ``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-credit-card.md b/examples/2.0.x/client-flutter/examples/avatars/get-credit-card.md index 50a9985f8..4665fcce1 100644 --- a/examples/2.0.x/client-flutter/examples/avatars/get-credit-card.md +++ b/examples/2.0.x/client-flutter/examples/avatars/get-credit-card.md @@ -1,4 +1,7 @@ ```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; import 'package:appwrite/enums.dart' as enums; @@ -8,10 +11,29 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getCreditCard( +// Downloading file +Uint8List bytes = await avatars.getCreditCard( code: enums.CreditCard.americanExpress, width: 0, // optional height: 0, // optional quality: -1, // optional ); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getCreditCard( + code: enums.CreditCard.americanExpress, + width: 0, // optional + height: 0, // optional + quality: -1, // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); ``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-favicon.md b/examples/2.0.x/client-flutter/examples/avatars/get-favicon.md index 810b95e43..5f523f814 100644 --- a/examples/2.0.x/client-flutter/examples/avatars/get-favicon.md +++ b/examples/2.0.x/client-flutter/examples/avatars/get-favicon.md @@ -1,4 +1,7 @@ ```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; Client client = Client() @@ -7,7 +10,23 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getFavicon( +// Downloading file +Uint8List bytes = await avatars.getFavicon( url: 'https://example.com', ); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getFavicon( + url: 'https://example.com', + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); ``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-flag.md b/examples/2.0.x/client-flutter/examples/avatars/get-flag.md index c4cbfb69d..552c22ccd 100644 --- a/examples/2.0.x/client-flutter/examples/avatars/get-flag.md +++ b/examples/2.0.x/client-flutter/examples/avatars/get-flag.md @@ -1,4 +1,7 @@ ```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; import 'package:appwrite/enums.dart' as enums; @@ -8,10 +11,29 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getFlag( +// Downloading file +Uint8List bytes = await avatars.getFlag( code: enums.Flag.afghanistan, width: 0, // optional height: 0, // optional quality: -1, // optional ); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getFlag( + code: enums.Flag.afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1, // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); ``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-image.md b/examples/2.0.x/client-flutter/examples/avatars/get-image.md index f7b24da8c..3f74cae01 100644 --- a/examples/2.0.x/client-flutter/examples/avatars/get-image.md +++ b/examples/2.0.x/client-flutter/examples/avatars/get-image.md @@ -1,4 +1,7 @@ ```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; Client client = Client() @@ -7,9 +10,27 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getImage( +// Downloading file +Uint8List bytes = await avatars.getImage( url: 'https://example.com', width: 0, // optional height: 0, // optional ); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getImage( + url: 'https://example.com', + width: 0, // optional + height: 0, // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); ``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-initials.md b/examples/2.0.x/client-flutter/examples/avatars/get-initials.md index f126d7976..89e20e7c6 100644 --- a/examples/2.0.x/client-flutter/examples/avatars/get-initials.md +++ b/examples/2.0.x/client-flutter/examples/avatars/get-initials.md @@ -1,4 +1,7 @@ ```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; Client client = Client() @@ -7,10 +10,29 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getInitials( +// Downloading file +Uint8List bytes = await avatars.getInitials( name: '', // optional width: 0, // optional height: 0, // optional background: 'FFFFFF', // optional ); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getInitials( + name: '', // optional + width: 0, // optional + height: 0, // optional + background: 'FFFFFF', // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); ``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-photo.md b/examples/2.0.x/client-flutter/examples/avatars/get-photo.md index ee0b3fcbe..371b19d91 100644 --- a/examples/2.0.x/client-flutter/examples/avatars/get-photo.md +++ b/examples/2.0.x/client-flutter/examples/avatars/get-photo.md @@ -1,4 +1,7 @@ ```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; Client client = Client() @@ -7,7 +10,8 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getPhoto( +// Downloading file +Uint8List bytes = await avatars.getPhoto( width: 0, // optional height: 0, // optional quality: 0, // optional @@ -17,4 +21,26 @@ Avatars avatars = Avatars(client); emailHash: '', // optional name: '', // optional ); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getPhoto( + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: 'png', // optional + rating: 'g', // optional + userId: 'current()', // optional + emailHash: '', // optional + name: '', // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); ``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-qr.md b/examples/2.0.x/client-flutter/examples/avatars/get-qr.md index 165b6a410..3579f4312 100644 --- a/examples/2.0.x/client-flutter/examples/avatars/get-qr.md +++ b/examples/2.0.x/client-flutter/examples/avatars/get-qr.md @@ -1,4 +1,7 @@ ```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; Client client = Client() @@ -7,10 +10,29 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getQR( +// Downloading file +Uint8List bytes = await avatars.getQR( text: '', size: 1, // optional margin: 0, // optional download: false, // optional ); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getQR( + text: '', + size: 1, // optional + margin: 0, // optional + download: false, // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); ``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-screenshot.md b/examples/2.0.x/client-flutter/examples/avatars/get-screenshot.md index 2d697bdb5..daa38d171 100644 --- a/examples/2.0.x/client-flutter/examples/avatars/get-screenshot.md +++ b/examples/2.0.x/client-flutter/examples/avatars/get-screenshot.md @@ -1,4 +1,7 @@ ```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; import 'package:appwrite/enums.dart' as enums; @@ -8,7 +11,8 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getScreenshot( +// Downloading file +Uint8List bytes = await avatars.getScreenshot( url: 'https://example.com', headers: { "Authorization": "Bearer token123", @@ -33,4 +37,41 @@ Avatars avatars = Avatars(client); quality: 85, // optional output: enums.ImageFormat.jpeg, // optional ); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getScreenshot( + url: 'https://example.com', + headers: { + "Authorization": "Bearer token123", + "X-Custom-Header": "value" + }, // optional + viewportWidth: 1920, // optional + viewportHeight: 1080, // optional + scale: 2, // optional + theme: enums.BrowserTheme.dark, // optional + userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional + fullpage: true, // optional + locale: 'en-US', // optional + timezone: enums.Timezone.africaAbidjan, // optional + latitude: 37.7749, // optional + longitude: -122.4194, // optional + accuracy: 100, // optional + touch: true, // optional + permissions: [enums.BrowserPermission.geolocation, enums.BrowserPermission.notifications], // optional + sleep: 3, // optional + width: 800, // optional + height: 600, // optional + quality: 85, // optional + output: enums.ImageFormat.jpeg, // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); ``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/create-document.md b/examples/2.0.x/client-flutter/examples/documentsdb/create-document.md new file mode 100644 index 000000000..d4b564e2e --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/create-document.md @@ -0,0 +1,26 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.createDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/create-documents.md b/examples/2.0.x/client-flutter/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..6a5083730 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/create-documents.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +DocumentList result = await documentsDB.createDocuments( + databaseId: '', + collectionId: '', + documents: [], + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/create-operations.md b/examples/2.0.x/client-flutter/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..a4d1ecddb --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/create-operations.md @@ -0,0 +1,24 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Transaction result = await documentsDB.createOperations( + transactionId: '', + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/create-transaction.md b/examples/2.0.x/client-flutter/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..2d9cb9f72 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/create-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Transaction result = await documentsDB.createTransaction( + ttl: 60, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-flutter/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..dcdac3aae --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.decrementDocumentAttribute( + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/delete-document.md b/examples/2.0.x/client-flutter/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..8d59422e1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/delete-document.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +await documentsDB.deleteDocument( + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/delete-transaction.md b/examples/2.0.x/client-flutter/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..9b95d9487 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/delete-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +await documentsDB.deleteTransaction( + transactionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/get-document.md b/examples/2.0.x/client-flutter/examples/documentsdb/get-document.md new file mode 100644 index 000000000..45db46e6a --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/get-document.md @@ -0,0 +1,17 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.getDocument( + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/get-transaction.md b/examples/2.0.x/client-flutter/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..4b1a5f1f8 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/get-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Transaction result = await documentsDB.getTransaction( + transactionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-flutter/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..c2c6e95c8 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.incrementDocumentAttribute( + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/list-documents.md b/examples/2.0.x/client-flutter/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..92d2651c5 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/list-documents.md @@ -0,0 +1,18 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +DocumentList result = await documentsDB.listDocuments( + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/list-transactions.md b/examples/2.0.x/client-flutter/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..d2c09525d --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/list-transactions.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +TransactionList result = await documentsDB.listTransactions( + queries: [], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/update-document.md b/examples/2.0.x/client-flutter/examples/documentsdb/update-document.md new file mode 100644 index 000000000..1b9fba9a5 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/update-document.md @@ -0,0 +1,20 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.updateDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/update-transaction.md b/examples/2.0.x/client-flutter/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..ebcf17be1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/update-transaction.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Transaction result = await documentsDB.updateTransaction( + transactionId: '', + commit: false, // optional + rollback: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/upsert-document.md b/examples/2.0.x/client-flutter/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..bdf3844b1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/upsert-document.md @@ -0,0 +1,20 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.upsertDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/storage/create-file.md b/examples/2.0.x/client-flutter/examples/storage/create-file.md index b2282211b..7d8fbd13c 100644 --- a/examples/2.0.x/client-flutter/examples/storage/create-file.md +++ b/examples/2.0.x/client-flutter/examples/storage/create-file.md @@ -1,4 +1,5 @@ ```dart +import 'dart:io'; import 'package:appwrite/appwrite.dart'; import 'package:appwrite/permission.dart'; import 'package:appwrite/role.dart'; diff --git a/examples/2.0.x/client-flutter/examples/storage/get-file-download.md b/examples/2.0.x/client-flutter/examples/storage/get-file-download.md index 3c6b03396..8e6e75eff 100644 --- a/examples/2.0.x/client-flutter/examples/storage/get-file-download.md +++ b/examples/2.0.x/client-flutter/examples/storage/get-file-download.md @@ -1,4 +1,7 @@ ```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; Client client = Client() @@ -7,9 +10,27 @@ Client client = Client() Storage storage = Storage(client); - result = await storage.getFileDownload( +// Downloading file +Uint8List bytes = await storage.getFileDownload( bucketId: '', fileId: '', token: '', // optional ); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: storage.getFileDownload( + bucketId: '', + fileId: '', + token: '', // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); ``` diff --git a/examples/2.0.x/client-flutter/examples/storage/get-file-preview.md b/examples/2.0.x/client-flutter/examples/storage/get-file-preview.md index 0a93944e3..bc811343a 100644 --- a/examples/2.0.x/client-flutter/examples/storage/get-file-preview.md +++ b/examples/2.0.x/client-flutter/examples/storage/get-file-preview.md @@ -1,4 +1,7 @@ ```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; import 'package:appwrite/enums.dart' as enums; @@ -8,12 +11,13 @@ Client client = Client() Storage storage = Storage(client); - result = await storage.getFilePreview( +// Downloading file +Uint8List bytes = await storage.getFilePreview( bucketId: '', fileId: '', width: 0, // optional height: 0, // optional - gravity: enums.ImageGravity.center, // optional + gravity: enums.ImageGravity.auto, // optional quality: -1, // optional borderWidth: 0, // optional borderColor: 'FFFFFF', // optional @@ -24,4 +28,32 @@ Storage storage = Storage(client); output: enums.ImageFormat.jpg, // optional token: '', // optional ); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: storage.getFilePreview( + bucketId: '', + fileId: '', + width: 0, // optional + height: 0, // optional + gravity: enums.ImageGravity.auto, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: 'FFFFFF', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: 'FFFFFF', // optional + output: enums.ImageFormat.jpg, // optional + token: '', // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); ``` diff --git a/examples/2.0.x/client-flutter/examples/storage/get-file-view.md b/examples/2.0.x/client-flutter/examples/storage/get-file-view.md index f14e82f38..6cc01b658 100644 --- a/examples/2.0.x/client-flutter/examples/storage/get-file-view.md +++ b/examples/2.0.x/client-flutter/examples/storage/get-file-view.md @@ -1,4 +1,7 @@ ```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; Client client = Client() @@ -7,9 +10,27 @@ Client client = Client() Storage storage = Storage(client); - result = await storage.getFileView( +// Downloading file +Uint8List bytes = await storage.getFileView( bucketId: '', fileId: '', token: '', // optional ); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: storage.getFileView( + bucketId: '', + fileId: '', + token: '', // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); ``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/create-document.md b/examples/2.0.x/client-flutter/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..fc39a7c10 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/create-document.md @@ -0,0 +1,30 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Document result = await vectorsDB.createDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: { + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "key": "value" + } + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/create-operations.md b/examples/2.0.x/client-flutter/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..a994693e3 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/create-operations.md @@ -0,0 +1,24 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Transaction result = await vectorsDB.createOperations( + transactionId: '', + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/create-query.md b/examples/2.0.x/client-flutter/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..fa41ee5c5 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/create-query.md @@ -0,0 +1,18 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +DocumentList result = await vectorsDB.createQuery( + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/create-transaction.md b/examples/2.0.x/client-flutter/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..9c8c96d3b --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/create-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Transaction result = await vectorsDB.createTransaction( + ttl: 60, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/delete-document.md b/examples/2.0.x/client-flutter/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..7827d9c36 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/delete-document.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +await vectorsDB.deleteDocument( + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/client-flutter/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..e4b82888f --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +await vectorsDB.deleteTransaction( + transactionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/get-document.md b/examples/2.0.x/client-flutter/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..28e544b37 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/get-document.md @@ -0,0 +1,17 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Document result = await vectorsDB.getDocument( + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/get-transaction.md b/examples/2.0.x/client-flutter/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..1d191d09c --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/get-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Transaction result = await vectorsDB.getTransaction( + transactionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/list-documents.md b/examples/2.0.x/client-flutter/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..03b4931de --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/list-documents.md @@ -0,0 +1,18 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +DocumentList result = await vectorsDB.listDocuments( + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/list-transactions.md b/examples/2.0.x/client-flutter/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..fb7f83dbf --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/list-transactions.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +TransactionList result = await vectorsDB.listTransactions( + queries: [], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/update-document.md b/examples/2.0.x/client-flutter/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..8c2a90919 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/update-document.md @@ -0,0 +1,20 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Document result = await vectorsDB.updateDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/update-transaction.md b/examples/2.0.x/client-flutter/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..1abd8b028 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/update-transaction.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Transaction result = await vectorsDB.updateTransaction( + transactionId: '', + commit: false, // optional + rollback: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/upsert-document.md b/examples/2.0.x/client-flutter/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..1367bba4a --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/upsert-document.md @@ -0,0 +1,20 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Document result = await vectorsDB.upsertDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-o-auth-2-session.md b/examples/2.0.x/client-graphql/examples/account/create-o-auth-2-session.md deleted file mode 100644 index 7d390717f..000000000 --- a/examples/2.0.x/client-graphql/examples/account/create-o-auth-2-session.md +++ /dev/null @@ -1,12 +0,0 @@ -```graphql -query { - accountCreateOAuth2Session( - provider: "amazon", - success: "https://example.com", - failure: "https://example.com", - scopes: [] - ) { - status - } -} -``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-o-auth-2-token.md b/examples/2.0.x/client-graphql/examples/account/create-o-auth-2-token.md deleted file mode 100644 index c6c1f5d55..000000000 --- a/examples/2.0.x/client-graphql/examples/account/create-o-auth-2-token.md +++ /dev/null @@ -1,12 +0,0 @@ -```graphql -query { - accountCreateOAuth2Token( - provider: "amazon", - success: "https://example.com", - failure: "https://example.com", - scopes: [] - ) { - status - } -} -``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/create-document.md b/examples/2.0.x/client-graphql/examples/documentsdb/create-document.md new file mode 100644 index 000000000..f8415e6af --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/create-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + documentsDBCreateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/create-documents.md b/examples/2.0.x/client-graphql/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..211576113 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/create-documents.md @@ -0,0 +1,22 @@ +```graphql +mutation { + documentsDBCreateDocuments( + databaseId: "", + collectionId: "", + documents: [], + transactionId: "" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/create-operations.md b/examples/2.0.x/client-graphql/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..153d00770 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/create-operations.md @@ -0,0 +1,25 @@ +```graphql +mutation { + documentsDBCreateOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/create-transaction.md b/examples/2.0.x/client-graphql/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..75a9d53d4 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/create-transaction.md @@ -0,0 +1,14 @@ +```graphql +mutation { + documentsDBCreateTransaction( + ttl: 60 + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-graphql/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..180e2af17 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + documentsDBDecrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, + min: 0, + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/delete-document.md b/examples/2.0.x/client-graphql/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..64f03c698 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/delete-document.md @@ -0,0 +1,12 @@ +```graphql +mutation { + documentsDBDeleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/delete-transaction.md b/examples/2.0.x/client-graphql/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..d6cea68f2 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/delete-transaction.md @@ -0,0 +1,9 @@ +```graphql +mutation { + documentsDBDeleteTransaction( + transactionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/get-document.md b/examples/2.0.x/client-graphql/examples/documentsdb/get-document.md new file mode 100644 index 000000000..970f56656 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/get-document.md @@ -0,0 +1,20 @@ +```graphql +query { + documentsDBGetDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: [], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/get-transaction.md b/examples/2.0.x/client-graphql/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..76e3dd728 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/get-transaction.md @@ -0,0 +1,14 @@ +```graphql +query { + documentsDBGetTransaction( + transactionId: "" + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-graphql/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..cb70414fd --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + documentsDBIncrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, + max: 100, + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/list-documents.md b/examples/2.0.x/client-graphql/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..89a23cf05 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/list-documents.md @@ -0,0 +1,24 @@ +```graphql +query { + documentsDBListDocuments( + databaseId: "", + collectionId: "", + queries: [], + transactionId: "", + total: false, + ttl: 0 + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/list-transactions.md b/examples/2.0.x/client-graphql/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..2569dde05 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/list-transactions.md @@ -0,0 +1,17 @@ +```graphql +query { + documentsDBListTransactions( + queries: [] + ) { + total + transactions { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/update-document.md b/examples/2.0.x/client-graphql/examples/documentsdb/update-document.md new file mode 100644 index 000000000..40a4898c9 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/update-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + documentsDBUpdateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/update-transaction.md b/examples/2.0.x/client-graphql/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..a9616ca48 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/update-transaction.md @@ -0,0 +1,16 @@ +```graphql +mutation { + documentsDBUpdateTransaction( + transactionId: "", + commit: false, + rollback: false + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/upsert-document.md b/examples/2.0.x/client-graphql/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..1b75a2830 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/upsert-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + documentsDBUpsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/storage/get-file-preview.md b/examples/2.0.x/client-graphql/examples/storage/get-file-preview.md index d4cc5edf0..0c06ca2b8 100644 --- a/examples/2.0.x/client-graphql/examples/storage/get-file-preview.md +++ b/examples/2.0.x/client-graphql/examples/storage/get-file-preview.md @@ -5,7 +5,7 @@ query { fileId: "", width: 0, height: 0, - gravity: "center", + gravity: "auto", quality: -1, borderWidth: 0, borderColor: "FFFFFF", diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/create-document.md b/examples/2.0.x/client-graphql/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..e81b723e9 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/create-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + vectorsDBCreateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{\"embeddings\":[0.12,-0.55,0.88,1.02],\"metadata\":{\"key\":\"value\"}}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/create-operations.md b/examples/2.0.x/client-graphql/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..b1d86d55b --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/create-operations.md @@ -0,0 +1,25 @@ +```graphql +mutation { + vectorsDBCreateOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/create-query.md b/examples/2.0.x/client-graphql/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..fac71fdf8 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/create-query.md @@ -0,0 +1,24 @@ +```graphql +mutation { + vectorsDBCreateQuery( + databaseId: "", + collectionId: "", + queries: [], + transactionId: "", + total: false, + ttl: 0 + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/create-transaction.md b/examples/2.0.x/client-graphql/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..d3057810c --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/create-transaction.md @@ -0,0 +1,14 @@ +```graphql +mutation { + vectorsDBCreateTransaction( + ttl: 60 + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/delete-document.md b/examples/2.0.x/client-graphql/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..2da5f257d --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/delete-document.md @@ -0,0 +1,12 @@ +```graphql +mutation { + vectorsDBDeleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/client-graphql/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..ba12d0e13 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,9 @@ +```graphql +mutation { + vectorsDBDeleteTransaction( + transactionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/get-document.md b/examples/2.0.x/client-graphql/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..4a2ca99c9 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/get-document.md @@ -0,0 +1,20 @@ +```graphql +query { + vectorsDBGetDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: [], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/get-transaction.md b/examples/2.0.x/client-graphql/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..df2dbc325 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/get-transaction.md @@ -0,0 +1,14 @@ +```graphql +query { + vectorsDBGetTransaction( + transactionId: "" + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/list-documents.md b/examples/2.0.x/client-graphql/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..68f1ff5c7 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/list-documents.md @@ -0,0 +1,24 @@ +```graphql +query { + vectorsDBListDocuments( + databaseId: "", + collectionId: "", + queries: [], + transactionId: "", + total: false, + ttl: 0 + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/list-transactions.md b/examples/2.0.x/client-graphql/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..1f2ea4aa4 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/list-transactions.md @@ -0,0 +1,17 @@ +```graphql +query { + vectorsDBListTransactions( + queries: [] + ) { + total + transactions { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/update-document.md b/examples/2.0.x/client-graphql/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..328c52df5 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/update-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + vectorsDBUpdateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/update-transaction.md b/examples/2.0.x/client-graphql/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..106a7b51d --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/update-transaction.md @@ -0,0 +1,16 @@ +```graphql +mutation { + vectorsDBUpdateTransaction( + transactionId: "", + commit: false, + rollback: false + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/upsert-document.md b/examples/2.0.x/client-graphql/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..21e56bc8b --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/upsert-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + vectorsDBUpsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-session.md b/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-session.md index 45e1ab685..c90edc145 100644 --- a/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-session.md +++ b/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-session.md @@ -7,12 +7,10 @@ const client = new Client() const account = new Account(client); -const result = await account.createOAuth2Session({ +account.createOAuth2Session({ provider: OAuthProvider.Amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional scopes: [], // optional }); - -console.log(result); ``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-token.md b/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-token.md index 90c09f586..c043fb78c 100644 --- a/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-token.md +++ b/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-token.md @@ -7,12 +7,10 @@ const client = new Client() const account = new Account(client); -const result = await account.createOAuth2Token({ +account.createOAuth2Token({ provider: OAuthProvider.Amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional scopes: [], // optional }); - -console.log(result); ``` diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-browser.md b/examples/2.0.x/client-react-native/examples/avatars/get-browser.md index a0165154a..d748496c9 100644 --- a/examples/2.0.x/client-react-native/examples/avatars/get-browser.md +++ b/examples/2.0.x/client-react-native/examples/avatars/get-browser.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getBrowser({ +const result = avatars.getBrowser({ code: Browser.AvantBrowser, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-credit-card.md b/examples/2.0.x/client-react-native/examples/avatars/get-credit-card.md index 682b0e312..604390fea 100644 --- a/examples/2.0.x/client-react-native/examples/avatars/get-credit-card.md +++ b/examples/2.0.x/client-react-native/examples/avatars/get-credit-card.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getCreditCard({ +const result = avatars.getCreditCard({ code: CreditCard.AmericanExpress, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-favicon.md b/examples/2.0.x/client-react-native/examples/avatars/get-favicon.md index 39d1ee972..ec54e8c56 100644 --- a/examples/2.0.x/client-react-native/examples/avatars/get-favicon.md +++ b/examples/2.0.x/client-react-native/examples/avatars/get-favicon.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getFavicon({ +const result = avatars.getFavicon({ url: 'https://example.com', }); diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-flag.md b/examples/2.0.x/client-react-native/examples/avatars/get-flag.md index 5bbb14127..8e5f4d7bd 100644 --- a/examples/2.0.x/client-react-native/examples/avatars/get-flag.md +++ b/examples/2.0.x/client-react-native/examples/avatars/get-flag.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getFlag({ +const result = avatars.getFlag({ code: Flag.Afghanistan, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-image.md b/examples/2.0.x/client-react-native/examples/avatars/get-image.md index 6e23e5a74..55abf9dca 100644 --- a/examples/2.0.x/client-react-native/examples/avatars/get-image.md +++ b/examples/2.0.x/client-react-native/examples/avatars/get-image.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getImage({ +const result = avatars.getImage({ url: 'https://example.com', width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-initials.md b/examples/2.0.x/client-react-native/examples/avatars/get-initials.md index f66323d24..bd4675aff 100644 --- a/examples/2.0.x/client-react-native/examples/avatars/get-initials.md +++ b/examples/2.0.x/client-react-native/examples/avatars/get-initials.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getInitials({ +const result = avatars.getInitials({ name: '', // optional width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-photo.md b/examples/2.0.x/client-react-native/examples/avatars/get-photo.md index 699cfab0d..44ca362b9 100644 --- a/examples/2.0.x/client-react-native/examples/avatars/get-photo.md +++ b/examples/2.0.x/client-react-native/examples/avatars/get-photo.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getPhoto({ +const result = avatars.getPhoto({ width: 0, // optional height: 0, // optional quality: 0, // optional diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-qr.md b/examples/2.0.x/client-react-native/examples/avatars/get-qr.md index fd23d5461..98c291b9d 100644 --- a/examples/2.0.x/client-react-native/examples/avatars/get-qr.md +++ b/examples/2.0.x/client-react-native/examples/avatars/get-qr.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getQR({ +const result = avatars.getQR({ text: '', size: 1, // optional margin: 0, // optional diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-screenshot.md b/examples/2.0.x/client-react-native/examples/avatars/get-screenshot.md index fa517416b..4e0402bc8 100644 --- a/examples/2.0.x/client-react-native/examples/avatars/get-screenshot.md +++ b/examples/2.0.x/client-react-native/examples/avatars/get-screenshot.md @@ -14,7 +14,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getScreenshot({ +const result = avatars.getScreenshot({ url: 'https://example.com', headers: { Authorization: 'Bearer token123', diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/create-document.md b/examples/2.0.x/client-react-native/examples/documentsdb/create-document.md new file mode 100644 index 000000000..51d69a975 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/create-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/create-documents.md b/examples/2.0.x/client-react-native/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..891757c68 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/create-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocuments({ + databaseId: '', + collectionId: '', + documents: [], + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/create-operations.md b/examples/2.0.x/client-react-native/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..41698bbf4 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/create-transaction.md b/examples/2.0.x/client-react-native/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..e535ea74b --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-react-native/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..ca7ed94fb --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.decrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/delete-document.md b/examples/2.0.x/client-react-native/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..ba07f8316 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/delete-transaction.md b/examples/2.0.x/client-react-native/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..a537cad48 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/get-document.md b/examples/2.0.x/client-react-native/examples/documentsdb/get-document.md new file mode 100644 index 000000000..64a5b43be --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/get-transaction.md b/examples/2.0.x/client-react-native/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..449f89245 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-react-native/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..80f4b0cc0 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.incrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/list-documents.md b/examples/2.0.x/client-react-native/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..b6a16cc2d --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/list-transactions.md b/examples/2.0.x/client-react-native/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..24c8dbdb1 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/update-document.md b/examples/2.0.x/client-react-native/examples/documentsdb/update-document.md new file mode 100644 index 000000000..cad772ded --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/update-transaction.md b/examples/2.0.x/client-react-native/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..df1009a61 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/upsert-document.md b/examples/2.0.x/client-react-native/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..52af7040e --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/storage/get-file-download.md b/examples/2.0.x/client-react-native/examples/storage/get-file-download.md index 5e117e21c..cba6f31c8 100644 --- a/examples/2.0.x/client-react-native/examples/storage/get-file-download.md +++ b/examples/2.0.x/client-react-native/examples/storage/get-file-download.md @@ -7,7 +7,7 @@ const client = new Client() const storage = new Storage(client); -const result = await storage.getFileDownload({ +const result = storage.getFileDownload({ bucketId: '', fileId: '', token: '', // optional diff --git a/examples/2.0.x/client-react-native/examples/storage/get-file-preview.md b/examples/2.0.x/client-react-native/examples/storage/get-file-preview.md index 4a444c9c0..eabdc1f23 100644 --- a/examples/2.0.x/client-react-native/examples/storage/get-file-preview.md +++ b/examples/2.0.x/client-react-native/examples/storage/get-file-preview.md @@ -12,12 +12,12 @@ const client = new Client() const storage = new Storage(client); -const result = await storage.getFilePreview({ +const result = storage.getFilePreview({ bucketId: '', fileId: '', width: 0, // optional height: 0, // optional - gravity: ImageGravity.Center, // optional + gravity: ImageGravity.Auto, // optional quality: -1, // optional borderWidth: 0, // optional borderColor: 'FFFFFF', // optional diff --git a/examples/2.0.x/client-react-native/examples/storage/get-file-view.md b/examples/2.0.x/client-react-native/examples/storage/get-file-view.md index bbcfbf6c7..99b341613 100644 --- a/examples/2.0.x/client-react-native/examples/storage/get-file-view.md +++ b/examples/2.0.x/client-react-native/examples/storage/get-file-view.md @@ -7,7 +7,7 @@ const client = new Client() const storage = new Storage(client); -const result = await storage.getFileView({ +const result = storage.getFileView({ bucketId: '', fileId: '', token: '', // optional diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/create-document.md b/examples/2.0.x/client-react-native/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..f2aaf4729 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/create-document.md @@ -0,0 +1,25 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + embeddings: [0.12, -0.55, 0.88, 1.02], + metadata: { + key: 'value', + }, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/create-operations.md b/examples/2.0.x/client-react-native/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..86be153fa --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/create-query.md b/examples/2.0.x/client-react-native/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..af9820000 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/create-query.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createQuery({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/create-transaction.md b/examples/2.0.x/client-react-native/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..8377619f7 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/delete-document.md b/examples/2.0.x/client-react-native/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..5046144d5 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/client-react-native/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..fc6cc5c53 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/get-document.md b/examples/2.0.x/client-react-native/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..1545ae996 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/get-transaction.md b/examples/2.0.x/client-react-native/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..b6e81c948 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/list-documents.md b/examples/2.0.x/client-react-native/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..fa79136ab --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/list-transactions.md b/examples/2.0.x/client-react-native/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..8a009a985 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/update-document.md b/examples/2.0.x/client-react-native/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..d2fa8794f --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/update-transaction.md b/examples/2.0.x/client-react-native/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..d1392088e --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/upsert-document.md b/examples/2.0.x/client-react-native/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..cabe87c07 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/create-document.md b/examples/2.0.x/client-rest/examples/documentsdb/create-document.md new file mode 100644 index 000000000..52d8070c5 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/create-document.md @@ -0,0 +1,21 @@ +```http +POST /v1/documentsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "documentId": "", + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/create-documents.md b/examples/2.0.x/client-rest/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..eaabe5614 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/create-documents.md @@ -0,0 +1,13 @@ +```http +POST /v1/documentsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "documents": [], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/create-operations.md b/examples/2.0.x/client-rest/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..1dcd46628 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/create-operations.md @@ -0,0 +1,22 @@ +```http +POST /v1/documentsdb/transactions/{transactionId}/operations HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "operations": [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/create-transaction.md b/examples/2.0.x/client-rest/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..0bfd5284d --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/create-transaction.md @@ -0,0 +1,12 @@ +```http +POST /v1/documentsdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "ttl": 60 +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-rest/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..14814b79b --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "value": 1, + "min": 0, + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/delete-document.md b/examples/2.0.x/client-rest/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..e22b30f85 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/delete-document.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/delete-transaction.md b/examples/2.0.x/client-rest/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..a8458e709 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/delete-transaction.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/documentsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/get-document.md b/examples/2.0.x/client-rest/examples/documentsdb/get-document.md new file mode 100644 index 000000000..179693312 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/get-document.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/get-transaction.md b/examples/2.0.x/client-rest/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..9495d52d2 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/get-transaction.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-rest/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..22e65a9ec --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "value": 1, + "max": 100, + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/list-documents.md b/examples/2.0.x/client-rest/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..e9e706462 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/list-documents.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/list-transactions.md b/examples/2.0.x/client-rest/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..c030724dd --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/list-transactions.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/update-document.md b/examples/2.0.x/client-rest/examples/documentsdb/update-document.md new file mode 100644 index 000000000..5b4583400 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/update-document.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "data": {}, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/update-transaction.md b/examples/2.0.x/client-rest/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..b23d949bb --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/update-transaction.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/documentsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "commit": false, + "rollback": false +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/upsert-document.md b/examples/2.0.x/client-rest/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..378f7c20b --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/upsert-document.md @@ -0,0 +1,14 @@ +```http +PUT /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "data": {}, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/graphql/mutation.md b/examples/2.0.x/client-rest/examples/graphql/mutation.md index 6f40a9985..a51586e9d 100644 --- a/examples/2.0.x/client-rest/examples/graphql/mutation.md +++ b/examples/2.0.x/client-rest/examples/graphql/mutation.md @@ -1,6 +1,7 @@ ```http POST /v1/graphql/mutation HTTP/1.1 Host: cloud.appwrite.io +X-Sdk-Graphql: true Content-Type: application/json Accept: application/json X-Appwrite-Response-Format: 2.0.0 diff --git a/examples/2.0.x/client-rest/examples/graphql/query.md b/examples/2.0.x/client-rest/examples/graphql/query.md index e133f3bc3..5029a563a 100644 --- a/examples/2.0.x/client-rest/examples/graphql/query.md +++ b/examples/2.0.x/client-rest/examples/graphql/query.md @@ -1,6 +1,7 @@ ```http POST /v1/graphql HTTP/1.1 Host: cloud.appwrite.io +X-Sdk-Graphql: true Content-Type: application/json Accept: application/json X-Appwrite-Response-Format: 2.0.0 diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/create-document.md b/examples/2.0.x/client-rest/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..97fba9e4a --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/create-document.md @@ -0,0 +1,25 @@ +```http +POST /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "documentId": "", + "data": { + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "key": "value" + } + }, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/create-operations.md b/examples/2.0.x/client-rest/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..7ad3d0670 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/create-operations.md @@ -0,0 +1,22 @@ +```http +POST /v1/vectorsdb/transactions/{transactionId}/operations HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "operations": [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/create-query.md b/examples/2.0.x/client-rest/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..9eebb305d --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/create-query.md @@ -0,0 +1,15 @@ +```http +POST /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/query HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "queries": [], + "transactionId": "", + "total": false, + "ttl": 0 +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/create-transaction.md b/examples/2.0.x/client-rest/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..50915dfc1 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/create-transaction.md @@ -0,0 +1,12 @@ +```http +POST /v1/vectorsdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "ttl": 60 +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/delete-document.md b/examples/2.0.x/client-rest/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..6380db120 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/delete-document.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/client-rest/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..6d65fcf3f --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/vectorsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/get-document.md b/examples/2.0.x/client-rest/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..f45584471 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/get-document.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/get-transaction.md b/examples/2.0.x/client-rest/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..c75b0f3b3 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/get-transaction.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/list-documents.md b/examples/2.0.x/client-rest/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..7a71b311d --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/list-documents.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/list-transactions.md b/examples/2.0.x/client-rest/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..ae17b9673 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/list-transactions.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/update-document.md b/examples/2.0.x/client-rest/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..8575c4f0a --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/update-document.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "data": {}, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/update-transaction.md b/examples/2.0.x/client-rest/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..cb67d33a9 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/update-transaction.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/vectorsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "commit": false, + "rollback": false +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/upsert-document.md b/examples/2.0.x/client-rest/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..a5ac42587 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/upsert-document.md @@ -0,0 +1,14 @@ +```http +PUT /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "data": {}, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-web/examples/account/create-o-auth-2-session.md b/examples/2.0.x/client-web/examples/account/create-o-auth-2-session.md index 7863bb67d..869e0f375 100644 --- a/examples/2.0.x/client-web/examples/account/create-o-auth-2-session.md +++ b/examples/2.0.x/client-web/examples/account/create-o-auth-2-session.md @@ -7,12 +7,10 @@ const client = new Client() const account = new Account(client); -const result = await account.createOAuth2Session({ +account.createOAuth2Session({ provider: OAuthProvider.Amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional scopes: [], // optional }); - -console.log(result); ``` diff --git a/examples/2.0.x/client-web/examples/account/create-o-auth-2-token.md b/examples/2.0.x/client-web/examples/account/create-o-auth-2-token.md index c8b067282..1cb7dd5a9 100644 --- a/examples/2.0.x/client-web/examples/account/create-o-auth-2-token.md +++ b/examples/2.0.x/client-web/examples/account/create-o-auth-2-token.md @@ -7,12 +7,10 @@ const client = new Client() const account = new Account(client); -const result = await account.createOAuth2Token({ +account.createOAuth2Token({ provider: OAuthProvider.Amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional scopes: [], // optional }); - -console.log(result); ``` diff --git a/examples/2.0.x/client-web/examples/avatars/get-browser.md b/examples/2.0.x/client-web/examples/avatars/get-browser.md index fffa4b2c7..a446f4dc8 100644 --- a/examples/2.0.x/client-web/examples/avatars/get-browser.md +++ b/examples/2.0.x/client-web/examples/avatars/get-browser.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getBrowser({ +const result = avatars.getBrowser({ code: Browser.AvantBrowser, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-web/examples/avatars/get-credit-card.md b/examples/2.0.x/client-web/examples/avatars/get-credit-card.md index eba950977..a644fda19 100644 --- a/examples/2.0.x/client-web/examples/avatars/get-credit-card.md +++ b/examples/2.0.x/client-web/examples/avatars/get-credit-card.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getCreditCard({ +const result = avatars.getCreditCard({ code: CreditCard.AmericanExpress, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-web/examples/avatars/get-favicon.md b/examples/2.0.x/client-web/examples/avatars/get-favicon.md index 7be2adfa6..8036a9f5a 100644 --- a/examples/2.0.x/client-web/examples/avatars/get-favicon.md +++ b/examples/2.0.x/client-web/examples/avatars/get-favicon.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getFavicon({ +const result = avatars.getFavicon({ url: 'https://example.com', }); diff --git a/examples/2.0.x/client-web/examples/avatars/get-flag.md b/examples/2.0.x/client-web/examples/avatars/get-flag.md index 937241805..5264199ee 100644 --- a/examples/2.0.x/client-web/examples/avatars/get-flag.md +++ b/examples/2.0.x/client-web/examples/avatars/get-flag.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getFlag({ +const result = avatars.getFlag({ code: Flag.Afghanistan, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-web/examples/avatars/get-image.md b/examples/2.0.x/client-web/examples/avatars/get-image.md index a213440ce..d5cd7300a 100644 --- a/examples/2.0.x/client-web/examples/avatars/get-image.md +++ b/examples/2.0.x/client-web/examples/avatars/get-image.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getImage({ +const result = avatars.getImage({ url: 'https://example.com', width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-web/examples/avatars/get-initials.md b/examples/2.0.x/client-web/examples/avatars/get-initials.md index b1a667892..03c6f9b15 100644 --- a/examples/2.0.x/client-web/examples/avatars/get-initials.md +++ b/examples/2.0.x/client-web/examples/avatars/get-initials.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getInitials({ +const result = avatars.getInitials({ name: '', // optional width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/client-web/examples/avatars/get-photo.md b/examples/2.0.x/client-web/examples/avatars/get-photo.md index e2f0f99f1..1b0567a33 100644 --- a/examples/2.0.x/client-web/examples/avatars/get-photo.md +++ b/examples/2.0.x/client-web/examples/avatars/get-photo.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getPhoto({ +const result = avatars.getPhoto({ width: 0, // optional height: 0, // optional quality: 0, // optional diff --git a/examples/2.0.x/client-web/examples/avatars/get-qr.md b/examples/2.0.x/client-web/examples/avatars/get-qr.md index 1eb93bd70..59cda9cf8 100644 --- a/examples/2.0.x/client-web/examples/avatars/get-qr.md +++ b/examples/2.0.x/client-web/examples/avatars/get-qr.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getQR({ +const result = avatars.getQR({ text: '', size: 1, // optional margin: 0, // optional diff --git a/examples/2.0.x/client-web/examples/avatars/get-screenshot.md b/examples/2.0.x/client-web/examples/avatars/get-screenshot.md index 9724f8ccf..680d225e4 100644 --- a/examples/2.0.x/client-web/examples/avatars/get-screenshot.md +++ b/examples/2.0.x/client-web/examples/avatars/get-screenshot.md @@ -14,7 +14,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getScreenshot({ +const result = avatars.getScreenshot({ url: 'https://example.com', headers: { Authorization: 'Bearer token123', diff --git a/examples/2.0.x/client-web/examples/documentsdb/create-document.md b/examples/2.0.x/client-web/examples/documentsdb/create-document.md new file mode 100644 index 000000000..b33c8780f --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/create-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/create-documents.md b/examples/2.0.x/client-web/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..c2830b94d --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/create-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocuments({ + databaseId: '', + collectionId: '', + documents: [], + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/create-operations.md b/examples/2.0.x/client-web/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..371f4cf3a --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/create-transaction.md b/examples/2.0.x/client-web/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..5eaf00656 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-web/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..75f4b0382 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.decrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/delete-document.md b/examples/2.0.x/client-web/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..e8b7e18b7 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/delete-transaction.md b/examples/2.0.x/client-web/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..97c1fe6f6 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/get-document.md b/examples/2.0.x/client-web/examples/documentsdb/get-document.md new file mode 100644 index 000000000..daedc268c --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/get-transaction.md b/examples/2.0.x/client-web/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..75cdd78f8 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-web/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..493b8a682 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.incrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/list-documents.md b/examples/2.0.x/client-web/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..26081239d --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/list-transactions.md b/examples/2.0.x/client-web/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..161d38804 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/update-document.md b/examples/2.0.x/client-web/examples/documentsdb/update-document.md new file mode 100644 index 000000000..5acecac7b --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/update-transaction.md b/examples/2.0.x/client-web/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..5f8d74dfb --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/upsert-document.md b/examples/2.0.x/client-web/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..3e10833c8 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/storage/get-file-download.md b/examples/2.0.x/client-web/examples/storage/get-file-download.md index 1f8a51346..bd2a7e60f 100644 --- a/examples/2.0.x/client-web/examples/storage/get-file-download.md +++ b/examples/2.0.x/client-web/examples/storage/get-file-download.md @@ -7,7 +7,7 @@ const client = new Client() const storage = new Storage(client); -const result = await storage.getFileDownload({ +const result = storage.getFileDownload({ bucketId: '', fileId: '', token: '', // optional diff --git a/examples/2.0.x/client-web/examples/storage/get-file-preview.md b/examples/2.0.x/client-web/examples/storage/get-file-preview.md index 5e9a3d34a..4d5913aa2 100644 --- a/examples/2.0.x/client-web/examples/storage/get-file-preview.md +++ b/examples/2.0.x/client-web/examples/storage/get-file-preview.md @@ -7,12 +7,12 @@ const client = new Client() const storage = new Storage(client); -const result = await storage.getFilePreview({ +const result = storage.getFilePreview({ bucketId: '', fileId: '', width: 0, // optional height: 0, // optional - gravity: ImageGravity.Center, // optional + gravity: ImageGravity.Auto, // optional quality: -1, // optional borderWidth: 0, // optional borderColor: 'FFFFFF', // optional diff --git a/examples/2.0.x/client-web/examples/storage/get-file-view.md b/examples/2.0.x/client-web/examples/storage/get-file-view.md index 2616b8a72..ba86f7c3d 100644 --- a/examples/2.0.x/client-web/examples/storage/get-file-view.md +++ b/examples/2.0.x/client-web/examples/storage/get-file-view.md @@ -7,7 +7,7 @@ const client = new Client() const storage = new Storage(client); -const result = await storage.getFileView({ +const result = storage.getFileView({ bucketId: '', fileId: '', token: '', // optional diff --git a/examples/2.0.x/client-web/examples/vectorsdb/create-document.md b/examples/2.0.x/client-web/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..f68aeef8c --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/create-document.md @@ -0,0 +1,25 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + embeddings: [0.12, -0.55, 0.88, 1.02], + metadata: { + key: 'value', + }, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/create-operations.md b/examples/2.0.x/client-web/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..35fb3d34b --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/create-query.md b/examples/2.0.x/client-web/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..e5de0f427 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/create-query.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createQuery({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/create-transaction.md b/examples/2.0.x/client-web/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..7ae265b50 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/delete-document.md b/examples/2.0.x/client-web/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..c7ccff599 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/client-web/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..c03b17dd6 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/get-document.md b/examples/2.0.x/client-web/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..ce4ffc24b --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/get-transaction.md b/examples/2.0.x/client-web/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..73f9d58a1 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/list-documents.md b/examples/2.0.x/client-web/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..99a76f3a5 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/list-transactions.md b/examples/2.0.x/client-web/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..a39afbc15 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/update-document.md b/examples/2.0.x/client-web/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..56453ccbb --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/update-transaction.md b/examples/2.0.x/client-web/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..c3e229fa9 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/upsert-document.md b/examples/2.0.x/client-web/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..a7143a960 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create-collection.md b/examples/2.0.x/console-cli/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..8f980b403 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create-collection.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb create-collection \ + --database-id '' \ + --collection-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create-document.md b/examples/2.0.x/console-cli/examples/documentsdb/create-document.md new file mode 100644 index 000000000..68d4ecf7c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create-document.md @@ -0,0 +1,7 @@ +```bash +appwrite documentsdb create-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' \ + --data '{ "key": "value" }' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create-documents.md b/examples/2.0.x/console-cli/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..ddaa05eaa --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb create-documents \ + --database-id '' \ + --collection-id '' \ + --documents one two three +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create-failover.md b/examples/2.0.x/console-cli/examples/documentsdb/create-failover.md new file mode 100644 index 000000000..691f06cb7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create-failover.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb create-failover \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create-index.md b/examples/2.0.x/console-cli/examples/documentsdb/create-index.md new file mode 100644 index 000000000..1fa9238a3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create-index.md @@ -0,0 +1,8 @@ +```bash +appwrite documentsdb create-index \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --type key \ + --attributes one two three +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create-transaction.md b/examples/2.0.x/console-cli/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..88689b617 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create-transaction.md @@ -0,0 +1,3 @@ +```bash +appwrite documentsdb create-transaction +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create.md b/examples/2.0.x/console-cli/examples/documentsdb/create.md new file mode 100644 index 000000000..bb9289c3e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create.md @@ -0,0 +1,5 @@ +```bash +appwrite documentsdb create \ + --database-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/console-cli/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..47ed69d7f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite documentsdb decrement-document-attribute \ + --database-id '' \ + --collection-id '' \ + --document-id '' \ + --attribute '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/delete-collection.md b/examples/2.0.x/console-cli/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..b625997af --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/delete-collection.md @@ -0,0 +1,5 @@ +```bash +appwrite documentsdb delete-collection \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/delete-document.md b/examples/2.0.x/console-cli/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..43ceaa13c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/delete-document.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb delete-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/delete-documents.md b/examples/2.0.x/console-cli/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..0d1b48540 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/delete-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb delete-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/delete-index.md b/examples/2.0.x/console-cli/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..056d9ea03 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/delete-index.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb delete-index \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/delete-transaction.md b/examples/2.0.x/console-cli/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..0f40b7a15 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/delete-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb delete-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/delete.md b/examples/2.0.x/console-cli/examples/documentsdb/delete.md new file mode 100644 index 000000000..4af9f935d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb delete \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/get-collection.md b/examples/2.0.x/console-cli/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..ff54073e4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/get-collection.md @@ -0,0 +1,5 @@ +```bash +appwrite documentsdb get-collection \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/get-document.md b/examples/2.0.x/console-cli/examples/documentsdb/get-document.md new file mode 100644 index 000000000..ff1958b31 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/get-document.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb get-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/get-index.md b/examples/2.0.x/console-cli/examples/documentsdb/get-index.md new file mode 100644 index 000000000..2a75462cb --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/get-index.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb get-index \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/get-replicas.md b/examples/2.0.x/console-cli/examples/documentsdb/get-replicas.md new file mode 100644 index 000000000..98d9c924b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/get-replicas.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb get-replicas \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/get-status.md b/examples/2.0.x/console-cli/examples/documentsdb/get-status.md new file mode 100644 index 000000000..807868e7e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/get-status.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb get-status \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/get-transaction.md b/examples/2.0.x/console-cli/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..1006a8b36 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/get-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb get-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/get.md b/examples/2.0.x/console-cli/examples/documentsdb/get.md new file mode 100644 index 000000000..7edadf333 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/get.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb get \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/console-cli/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..508e8abfb --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite documentsdb increment-document-attribute \ + --database-id '' \ + --collection-id '' \ + --document-id '' \ + --attribute '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/list-collections.md b/examples/2.0.x/console-cli/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..1dec21a43 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/list-collections.md @@ -0,0 +1,5 @@ +```bash +appwrite documentsdb list-collections \ + --database-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/list-documents.md b/examples/2.0.x/console-cli/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..83eca6e83 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/list-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb list-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/list-indexes.md b/examples/2.0.x/console-cli/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..e7b7d269d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/list-indexes.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb list-indexes \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/list-operations.md b/examples/2.0.x/console-cli/examples/documentsdb/list-operations.md new file mode 100644 index 000000000..0b1a12b24 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/list-operations.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb list-operations \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/list-specifications.md b/examples/2.0.x/console-cli/examples/documentsdb/list-specifications.md new file mode 100644 index 000000000..f0a2bc2cb --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/list-specifications.md @@ -0,0 +1,3 @@ +```bash +appwrite documentsdb list-specifications +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/list-transactions.md b/examples/2.0.x/console-cli/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..187f2055c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/list-transactions.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb list-transactions \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/list.md b/examples/2.0.x/console-cli/examples/documentsdb/list.md new file mode 100644 index 000000000..6838fea75 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/list.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/update-collection.md b/examples/2.0.x/console-cli/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..d6ff0d6c9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/update-collection.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb update-collection \ + --database-id '' \ + --collection-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/update-document.md b/examples/2.0.x/console-cli/examples/documentsdb/update-document.md new file mode 100644 index 000000000..4548c5609 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/update-document.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb update-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/update-documents.md b/examples/2.0.x/console-cli/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..e84b6ca07 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/update-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb update-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/update-transaction.md b/examples/2.0.x/console-cli/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..5ae411cc3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/update-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb update-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/update.md b/examples/2.0.x/console-cli/examples/documentsdb/update.md new file mode 100644 index 000000000..c6ac2440f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/update.md @@ -0,0 +1,5 @@ +```bash +appwrite documentsdb update \ + --database-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/upsert-document.md b/examples/2.0.x/console-cli/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..7f65bbd64 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/upsert-document.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb upsert-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/upsert-documents.md b/examples/2.0.x/console-cli/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..646977ad2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/upsert-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb upsert-documents \ + --database-id '' \ + --collection-id '' \ + --documents one two three +``` diff --git a/examples/2.0.x/console-cli/examples/oauth2/authorize-post.md b/examples/2.0.x/console-cli/examples/oauth2/authorize-post.md index 032a9df37..51d79ad9f 100644 --- a/examples/2.0.x/console-cli/examples/oauth2/authorize-post.md +++ b/examples/2.0.x/console-cli/examples/oauth2/authorize-post.md @@ -1,3 +1,4 @@ ```bash -appwrite oauth2 authorize-post +appwrite oauth2 authorize-post \ + --project-id '' ``` diff --git a/examples/2.0.x/console-cli/examples/oauth2/authorize.md b/examples/2.0.x/console-cli/examples/oauth2/authorize.md index f1a40a099..69748c02f 100644 --- a/examples/2.0.x/console-cli/examples/oauth2/authorize.md +++ b/examples/2.0.x/console-cli/examples/oauth2/authorize.md @@ -1,3 +1,4 @@ ```bash -appwrite oauth2 authorize +appwrite oauth2 authorize \ + --project-id '' ``` diff --git a/examples/2.0.x/console-cli/examples/oauth2/create-device-authorization.md b/examples/2.0.x/console-cli/examples/oauth2/create-device-authorization.md index a9c91f059..0d617dc9a 100644 --- a/examples/2.0.x/console-cli/examples/oauth2/create-device-authorization.md +++ b/examples/2.0.x/console-cli/examples/oauth2/create-device-authorization.md @@ -1,3 +1,4 @@ ```bash -appwrite oauth2 create-device-authorization +appwrite oauth2 create-device-authorization \ + --project-id '' ``` diff --git a/examples/2.0.x/console-cli/examples/oauth2/create-grant.md b/examples/2.0.x/console-cli/examples/oauth2/create-grant.md index a99087aff..5de036805 100644 --- a/examples/2.0.x/console-cli/examples/oauth2/create-grant.md +++ b/examples/2.0.x/console-cli/examples/oauth2/create-grant.md @@ -1,4 +1,5 @@ ```bash appwrite oauth2 create-grant \ + --project-id '' \ --user-code '' ``` diff --git a/examples/2.0.x/console-cli/examples/oauth2/create-par.md b/examples/2.0.x/console-cli/examples/oauth2/create-par.md index da93b0066..c6045181d 100644 --- a/examples/2.0.x/console-cli/examples/oauth2/create-par.md +++ b/examples/2.0.x/console-cli/examples/oauth2/create-par.md @@ -1,5 +1,6 @@ ```bash appwrite oauth2 create-par \ + --project-id '' \ --client-id '' \ --redirect-uri https://example.com \ --response-type code diff --git a/examples/2.0.x/console-cli/examples/oauth2/create-token.md b/examples/2.0.x/console-cli/examples/oauth2/create-token.md index 3564bc441..b4748a469 100644 --- a/examples/2.0.x/console-cli/examples/oauth2/create-token.md +++ b/examples/2.0.x/console-cli/examples/oauth2/create-token.md @@ -1,4 +1,5 @@ ```bash appwrite oauth2 create-token \ + --project-id '' \ --grant-type '' ``` diff --git a/examples/2.0.x/console-cli/examples/oauth2/get-grant.md b/examples/2.0.x/console-cli/examples/oauth2/get-grant.md index 68b0d0672..38cd7082c 100644 --- a/examples/2.0.x/console-cli/examples/oauth2/get-grant.md +++ b/examples/2.0.x/console-cli/examples/oauth2/get-grant.md @@ -1,4 +1,5 @@ ```bash appwrite oauth2 get-grant \ + --project-id '' \ --grant-id '' ``` diff --git a/examples/2.0.x/console-cli/examples/oauth2/list-organizations.md b/examples/2.0.x/console-cli/examples/oauth2/list-organizations.md index 40cc3e465..d677f02dd 100644 --- a/examples/2.0.x/console-cli/examples/oauth2/list-organizations.md +++ b/examples/2.0.x/console-cli/examples/oauth2/list-organizations.md @@ -1,3 +1,4 @@ ```bash -appwrite list-organizations +appwrite list-organizations \ + --project-id '' ``` diff --git a/examples/2.0.x/console-cli/examples/oauth2/list-projects.md b/examples/2.0.x/console-cli/examples/oauth2/list-projects.md index 5c2f974b8..4ef7a1eac 100644 --- a/examples/2.0.x/console-cli/examples/oauth2/list-projects.md +++ b/examples/2.0.x/console-cli/examples/oauth2/list-projects.md @@ -1,3 +1,4 @@ ```bash -appwrite list-projects +appwrite list-projects \ + --project-id '' ``` diff --git a/examples/2.0.x/console-cli/examples/oauth2/reject.md b/examples/2.0.x/console-cli/examples/oauth2/reject.md index ddc5e5796..df0a5c3cf 100644 --- a/examples/2.0.x/console-cli/examples/oauth2/reject.md +++ b/examples/2.0.x/console-cli/examples/oauth2/reject.md @@ -1,4 +1,5 @@ ```bash appwrite oauth2 reject \ + --project-id '' \ --grant-id '' ``` diff --git a/examples/2.0.x/console-cli/examples/oauth2/revoke.md b/examples/2.0.x/console-cli/examples/oauth2/revoke.md index da472606d..3cabcf5ee 100644 --- a/examples/2.0.x/console-cli/examples/oauth2/revoke.md +++ b/examples/2.0.x/console-cli/examples/oauth2/revoke.md @@ -1,4 +1,5 @@ ```bash appwrite oauth2 revoke \ + --project-id '' \ --token '' ``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-collection.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..c03fd786c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-collection.md @@ -0,0 +1,7 @@ +```bash +appwrite vectorsdb create-collection \ + --database-id '' \ + --collection-id '' \ + --name '' \ + --dimension 1 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-document.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..4fdd19bd7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-document.md @@ -0,0 +1,7 @@ +```bash +appwrite vectorsdb create-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' \ + --data '{ "key": "value" }' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-documents.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..a47c7dc0b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb create-documents \ + --database-id '' \ + --collection-id '' \ + --documents one two three +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-failover.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-failover.md new file mode 100644 index 000000000..109a84b03 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-failover.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb create-failover \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-index.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..98d47f7de --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-index.md @@ -0,0 +1,8 @@ +```bash +appwrite vectorsdb create-index \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --type hnsw_euclidean \ + --attributes one two three +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-operations.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..6ce4e7c22 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-operations.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb create-operations \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-query.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..582a16dcd --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-query.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb create-query \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-transaction.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..490406a3f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-transaction.md @@ -0,0 +1,3 @@ +```bash +appwrite vectorsdb create-transaction +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create.md b/examples/2.0.x/console-cli/examples/vectorsdb/create.md new file mode 100644 index 000000000..a863caa15 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create.md @@ -0,0 +1,5 @@ +```bash +appwrite vectorsdb create \ + --database-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/delete-collection.md b/examples/2.0.x/console-cli/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..9f123c9d5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/delete-collection.md @@ -0,0 +1,5 @@ +```bash +appwrite vectorsdb delete-collection \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/delete-document.md b/examples/2.0.x/console-cli/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..78029bce2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/delete-document.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb delete-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/delete-documents.md b/examples/2.0.x/console-cli/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..b9a531b73 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/delete-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb delete-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/delete-index.md b/examples/2.0.x/console-cli/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..ce3f8a91c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/delete-index.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb delete-index \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/console-cli/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..59062aef5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb delete-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/delete.md b/examples/2.0.x/console-cli/examples/vectorsdb/delete.md new file mode 100644 index 000000000..d681a332c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb delete \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/get-collection.md b/examples/2.0.x/console-cli/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..0759bb8c5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/get-collection.md @@ -0,0 +1,5 @@ +```bash +appwrite vectorsdb get-collection \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/get-document.md b/examples/2.0.x/console-cli/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..17571f5cd --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/get-document.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb get-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/get-index.md b/examples/2.0.x/console-cli/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..9444017b9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/get-index.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb get-index \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/get-replicas.md b/examples/2.0.x/console-cli/examples/vectorsdb/get-replicas.md new file mode 100644 index 000000000..5e92f3c87 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/get-replicas.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb get-replicas \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/get-status.md b/examples/2.0.x/console-cli/examples/vectorsdb/get-status.md new file mode 100644 index 000000000..cb997703c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/get-status.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb get-status \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/get-transaction.md b/examples/2.0.x/console-cli/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..ca23c4943 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/get-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb get-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/get.md b/examples/2.0.x/console-cli/examples/vectorsdb/get.md new file mode 100644 index 000000000..2faaf41a7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/get.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb get \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/list-collections.md b/examples/2.0.x/console-cli/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..13cae17fd --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/list-collections.md @@ -0,0 +1,5 @@ +```bash +appwrite vectorsdb list-collections \ + --database-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/list-documents.md b/examples/2.0.x/console-cli/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..3cf9203cc --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/list-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb list-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/list-indexes.md b/examples/2.0.x/console-cli/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..cec349c74 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/list-indexes.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb list-indexes \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/list-operations.md b/examples/2.0.x/console-cli/examples/vectorsdb/list-operations.md new file mode 100644 index 000000000..8bdad3302 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/list-operations.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb list-operations \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/list-specifications.md b/examples/2.0.x/console-cli/examples/vectorsdb/list-specifications.md new file mode 100644 index 000000000..7cceb489a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/list-specifications.md @@ -0,0 +1,3 @@ +```bash +appwrite vectorsdb list-specifications +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/list-transactions.md b/examples/2.0.x/console-cli/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..526e7a149 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/list-transactions.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb list-transactions \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/list.md b/examples/2.0.x/console-cli/examples/vectorsdb/list.md new file mode 100644 index 000000000..4168e0dd6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/list.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/update-collection.md b/examples/2.0.x/console-cli/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..4d962a905 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/update-collection.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb update-collection \ + --database-id '' \ + --collection-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/update-document.md b/examples/2.0.x/console-cli/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..ae1856c10 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/update-document.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb update-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/update-documents.md b/examples/2.0.x/console-cli/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..90eebc50e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/update-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb update-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/update-transaction.md b/examples/2.0.x/console-cli/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..cfcb79f80 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/update-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb update-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/update.md b/examples/2.0.x/console-cli/examples/vectorsdb/update.md new file mode 100644 index 000000000..4ba16bd63 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/update.md @@ -0,0 +1,5 @@ +```bash +appwrite vectorsdb update \ + --database-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/upsert-document.md b/examples/2.0.x/console-cli/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..74ca86e14 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/upsert-document.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb upsert-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/console-cli/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..01ca49d71 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb upsert-documents \ + --database-id '' \ + --collection-id '' \ + --documents one two three +``` diff --git a/examples/2.0.x/console-python/examples/account/create-o-auth-2-session.md b/examples/2.0.x/console-python/examples/account/create-o-auth-2-session.md index a4729e665..715581e93 100644 --- a/examples/2.0.x/console-python/examples/account/create-o-auth-2-session.md +++ b/examples/2.0.x/console-python/examples/account/create-o-auth-2-session.md @@ -9,7 +9,7 @@ client.set_project('') # Your project ID account = Account(client) -result = account.create_o_auth2_session( +result: str = account.create_o_auth2_session( provider = OAuthProvider.AMAZON, success = 'https://example.com', # optional failure = 'https://example.com', # optional diff --git a/examples/2.0.x/console-python/examples/account/create-o-auth-2-token.md b/examples/2.0.x/console-python/examples/account/create-o-auth-2-token.md index 70d653cd9..8b171cdc2 100644 --- a/examples/2.0.x/console-python/examples/account/create-o-auth-2-token.md +++ b/examples/2.0.x/console-python/examples/account/create-o-auth-2-token.md @@ -9,7 +9,7 @@ client.set_project('') # Your project ID account = Account(client) -result = account.create_o_auth2_token( +result: str = account.create_o_auth2_token( provider = OAuthProvider.AMAZON, success = 'https://example.com', # optional failure = 'https://example.com', # optional diff --git a/examples/2.0.x/console-python/examples/avatars/get-browser.md b/examples/2.0.x/console-python/examples/avatars/get-browser.md index c13d530d0..ef469e2d1 100644 --- a/examples/2.0.x/console-python/examples/avatars/get-browser.md +++ b/examples/2.0.x/console-python/examples/avatars/get-browser.md @@ -9,7 +9,7 @@ client.set_project('') # Your project ID avatars = Avatars(client) -result = avatars.get_browser( +result: bytes = avatars.get_browser( code = Browser.AVANT_BROWSER, width = 0, # optional height = 0, # optional diff --git a/examples/2.0.x/console-python/examples/avatars/get-credit-card.md b/examples/2.0.x/console-python/examples/avatars/get-credit-card.md index 8a6988719..f9ee5b865 100644 --- a/examples/2.0.x/console-python/examples/avatars/get-credit-card.md +++ b/examples/2.0.x/console-python/examples/avatars/get-credit-card.md @@ -9,7 +9,7 @@ client.set_project('') # Your project ID avatars = Avatars(client) -result = avatars.get_credit_card( +result: bytes = avatars.get_credit_card( code = CreditCard.AMERICAN_EXPRESS, width = 0, # optional height = 0, # optional diff --git a/examples/2.0.x/console-python/examples/avatars/get-favicon.md b/examples/2.0.x/console-python/examples/avatars/get-favicon.md index 6dc308d14..04f1a4a93 100644 --- a/examples/2.0.x/console-python/examples/avatars/get-favicon.md +++ b/examples/2.0.x/console-python/examples/avatars/get-favicon.md @@ -8,7 +8,7 @@ client.set_project('') # Your project ID avatars = Avatars(client) -result = avatars.get_favicon( +result: bytes = avatars.get_favicon( url = 'https://example.com' ) ``` diff --git a/examples/2.0.x/console-python/examples/avatars/get-flag.md b/examples/2.0.x/console-python/examples/avatars/get-flag.md index b2467c898..0e69f14bb 100644 --- a/examples/2.0.x/console-python/examples/avatars/get-flag.md +++ b/examples/2.0.x/console-python/examples/avatars/get-flag.md @@ -9,7 +9,7 @@ client.set_project('') # Your project ID avatars = Avatars(client) -result = avatars.get_flag( +result: bytes = avatars.get_flag( code = Flag.AFGHANISTAN, width = 0, # optional height = 0, # optional diff --git a/examples/2.0.x/console-python/examples/avatars/get-image.md b/examples/2.0.x/console-python/examples/avatars/get-image.md index 519444ba1..f642a9a87 100644 --- a/examples/2.0.x/console-python/examples/avatars/get-image.md +++ b/examples/2.0.x/console-python/examples/avatars/get-image.md @@ -8,7 +8,7 @@ client.set_project('') # Your project ID avatars = Avatars(client) -result = avatars.get_image( +result: bytes = avatars.get_image( url = 'https://example.com', width = 0, # optional height = 0 # optional diff --git a/examples/2.0.x/console-python/examples/avatars/get-initials.md b/examples/2.0.x/console-python/examples/avatars/get-initials.md index 0f1b9a687..197c2f659 100644 --- a/examples/2.0.x/console-python/examples/avatars/get-initials.md +++ b/examples/2.0.x/console-python/examples/avatars/get-initials.md @@ -8,7 +8,7 @@ client.set_project('') # Your project ID avatars = Avatars(client) -result = avatars.get_initials( +result: bytes = avatars.get_initials( name = '', # optional width = 0, # optional height = 0, # optional diff --git a/examples/2.0.x/console-python/examples/avatars/get-photo.md b/examples/2.0.x/console-python/examples/avatars/get-photo.md index e9817c4d3..55ac46375 100644 --- a/examples/2.0.x/console-python/examples/avatars/get-photo.md +++ b/examples/2.0.x/console-python/examples/avatars/get-photo.md @@ -8,7 +8,7 @@ client.set_project('') # Your project ID avatars = Avatars(client) -result = avatars.get_photo( +result: bytes = avatars.get_photo( width = 0, # optional height = 0, # optional quality = 0, # optional diff --git a/examples/2.0.x/console-python/examples/avatars/get-qr.md b/examples/2.0.x/console-python/examples/avatars/get-qr.md index 1bdbb4c8c..7a1b0b80e 100644 --- a/examples/2.0.x/console-python/examples/avatars/get-qr.md +++ b/examples/2.0.x/console-python/examples/avatars/get-qr.md @@ -8,7 +8,7 @@ client.set_project('') # Your project ID avatars = Avatars(client) -result = avatars.get_qr( +result: bytes = avatars.get_qr( text = '', size = 1, # optional margin = 0, # optional diff --git a/examples/2.0.x/console-python/examples/avatars/get-screenshot.md b/examples/2.0.x/console-python/examples/avatars/get-screenshot.md index 4200a9e42..5f74ca094 100644 --- a/examples/2.0.x/console-python/examples/avatars/get-screenshot.md +++ b/examples/2.0.x/console-python/examples/avatars/get-screenshot.md @@ -12,7 +12,7 @@ client.set_project('') # Your project ID avatars = Avatars(client) -result = avatars.get_screenshot( +result: bytes = avatars.get_screenshot( url = 'https://example.com', headers = { "Authorization": "Bearer token123", diff --git a/examples/2.0.x/console-python/examples/functions/get-deployment-download.md b/examples/2.0.x/console-python/examples/functions/get-deployment-download.md index 8e2d4ef52..53120af0b 100644 --- a/examples/2.0.x/console-python/examples/functions/get-deployment-download.md +++ b/examples/2.0.x/console-python/examples/functions/get-deployment-download.md @@ -9,7 +9,7 @@ client.set_project('') # Your project ID functions = Functions(client) -result = functions.get_deployment_download( +result: bytes = functions.get_deployment_download( function_id = '', deployment_id = '', type = DeploymentDownloadType.SOURCE, # optional diff --git a/examples/2.0.x/console-python/examples/organizations/get-invoice-download.md b/examples/2.0.x/console-python/examples/organizations/get-invoice-download.md index f1563a537..7116e7819 100644 --- a/examples/2.0.x/console-python/examples/organizations/get-invoice-download.md +++ b/examples/2.0.x/console-python/examples/organizations/get-invoice-download.md @@ -1,7 +1,6 @@ ```python from appwrite_console.client import Client from appwrite_console.services.organizations import Organizations -from appwrite_console.models import PaymentMethod client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -9,10 +8,8 @@ client.set_project('') # Your project ID organizations = Organizations(client) -result: PaymentMethod = organizations.get_invoice_download( +result: bytes = organizations.get_invoice_download( organization_id = '', invoice_id = '' ) - -print(result.model_dump()) ``` diff --git a/examples/2.0.x/console-python/examples/organizations/get-invoice-view.md b/examples/2.0.x/console-python/examples/organizations/get-invoice-view.md index 1edcaba28..1f2ff2fed 100644 --- a/examples/2.0.x/console-python/examples/organizations/get-invoice-view.md +++ b/examples/2.0.x/console-python/examples/organizations/get-invoice-view.md @@ -1,7 +1,6 @@ ```python from appwrite_console.client import Client from appwrite_console.services.organizations import Organizations -from appwrite_console.models import PaymentMethod client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -9,10 +8,8 @@ client.set_project('') # Your project ID organizations = Organizations(client) -result: PaymentMethod = organizations.get_invoice_view( +result: bytes = organizations.get_invoice_view( organization_id = '', invoice_id = '' ) - -print(result.model_dump()) ``` diff --git a/examples/2.0.x/console-python/examples/sites/get-deployment-download.md b/examples/2.0.x/console-python/examples/sites/get-deployment-download.md index 7047aff2e..0cae57f34 100644 --- a/examples/2.0.x/console-python/examples/sites/get-deployment-download.md +++ b/examples/2.0.x/console-python/examples/sites/get-deployment-download.md @@ -9,7 +9,7 @@ client.set_project('') # Your project ID sites = Sites(client) -result = sites.get_deployment_download( +result: bytes = sites.get_deployment_download( site_id = '', deployment_id = '', type = DeploymentDownloadType.SOURCE, # optional diff --git a/examples/2.0.x/console-python/examples/storage/get-file-download.md b/examples/2.0.x/console-python/examples/storage/get-file-download.md index 7f0d1c9d7..6c272faae 100644 --- a/examples/2.0.x/console-python/examples/storage/get-file-download.md +++ b/examples/2.0.x/console-python/examples/storage/get-file-download.md @@ -8,7 +8,7 @@ client.set_project('') # Your project ID storage = Storage(client) -result = storage.get_file_download( +result: bytes = storage.get_file_download( bucket_id = '', file_id = '', token = '' # optional diff --git a/examples/2.0.x/console-python/examples/storage/get-file-preview.md b/examples/2.0.x/console-python/examples/storage/get-file-preview.md index 73b5da82d..a5edaa9fe 100644 --- a/examples/2.0.x/console-python/examples/storage/get-file-preview.md +++ b/examples/2.0.x/console-python/examples/storage/get-file-preview.md @@ -10,12 +10,12 @@ client.set_project('') # Your project ID storage = Storage(client) -result = storage.get_file_preview( +result: bytes = storage.get_file_preview( bucket_id = '', file_id = '', width = 0, # optional height = 0, # optional - gravity = ImageGravity.CENTER, # optional + gravity = ImageGravity.AUTO, # optional quality = -1, # optional border_width = 0, # optional border_color = 'FFFFFF', # optional diff --git a/examples/2.0.x/console-python/examples/storage/get-file-view.md b/examples/2.0.x/console-python/examples/storage/get-file-view.md index 665b7805c..b5b3fda74 100644 --- a/examples/2.0.x/console-python/examples/storage/get-file-view.md +++ b/examples/2.0.x/console-python/examples/storage/get-file-view.md @@ -8,7 +8,7 @@ client.set_project('') # Your project ID storage = Storage(client) -result = storage.get_file_view( +result: bytes = storage.get_file_view( bucket_id = '', file_id = '', token = '' # optional diff --git a/examples/2.0.x/console-web/examples/account/create-o-auth-2-session.md b/examples/2.0.x/console-web/examples/account/create-o-auth-2-session.md index 1ec82b47d..735fd2eac 100644 --- a/examples/2.0.x/console-web/examples/account/create-o-auth-2-session.md +++ b/examples/2.0.x/console-web/examples/account/create-o-auth-2-session.md @@ -7,12 +7,10 @@ const client = new Client() const account = new Account(client); -const result = await account.createOAuth2Session({ +account.createOAuth2Session({ provider: OAuthProvider.Amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional scopes: [], // optional }); - -console.log(result); ``` diff --git a/examples/2.0.x/console-web/examples/account/create-o-auth-2-token.md b/examples/2.0.x/console-web/examples/account/create-o-auth-2-token.md index 4ff0e6104..cf961db67 100644 --- a/examples/2.0.x/console-web/examples/account/create-o-auth-2-token.md +++ b/examples/2.0.x/console-web/examples/account/create-o-auth-2-token.md @@ -7,12 +7,10 @@ const client = new Client() const account = new Account(client); -const result = await account.createOAuth2Token({ +account.createOAuth2Token({ provider: OAuthProvider.Amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional scopes: [], // optional }); - -console.log(result); ``` diff --git a/examples/2.0.x/console-web/examples/avatars/get-browser.md b/examples/2.0.x/console-web/examples/avatars/get-browser.md index 6f138c8d6..5dd1daa6e 100644 --- a/examples/2.0.x/console-web/examples/avatars/get-browser.md +++ b/examples/2.0.x/console-web/examples/avatars/get-browser.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getBrowser({ +const result = avatars.getBrowser({ code: Browser.AvantBrowser, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/console-web/examples/avatars/get-credit-card.md b/examples/2.0.x/console-web/examples/avatars/get-credit-card.md index 7f1d385de..dd3864861 100644 --- a/examples/2.0.x/console-web/examples/avatars/get-credit-card.md +++ b/examples/2.0.x/console-web/examples/avatars/get-credit-card.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getCreditCard({ +const result = avatars.getCreditCard({ code: CreditCard.AmericanExpress, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/console-web/examples/avatars/get-favicon.md b/examples/2.0.x/console-web/examples/avatars/get-favicon.md index 8dcc5dda7..ccb69b0aa 100644 --- a/examples/2.0.x/console-web/examples/avatars/get-favicon.md +++ b/examples/2.0.x/console-web/examples/avatars/get-favicon.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getFavicon({ +const result = avatars.getFavicon({ url: 'https://example.com', }); diff --git a/examples/2.0.x/console-web/examples/avatars/get-flag.md b/examples/2.0.x/console-web/examples/avatars/get-flag.md index 1f51b5acd..cacde8ff1 100644 --- a/examples/2.0.x/console-web/examples/avatars/get-flag.md +++ b/examples/2.0.x/console-web/examples/avatars/get-flag.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getFlag({ +const result = avatars.getFlag({ code: Flag.Afghanistan, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/console-web/examples/avatars/get-image.md b/examples/2.0.x/console-web/examples/avatars/get-image.md index a2f00ff9b..8cf0eaa2a 100644 --- a/examples/2.0.x/console-web/examples/avatars/get-image.md +++ b/examples/2.0.x/console-web/examples/avatars/get-image.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getImage({ +const result = avatars.getImage({ url: 'https://example.com', width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/console-web/examples/avatars/get-initials.md b/examples/2.0.x/console-web/examples/avatars/get-initials.md index 2a262a17d..ef898edda 100644 --- a/examples/2.0.x/console-web/examples/avatars/get-initials.md +++ b/examples/2.0.x/console-web/examples/avatars/get-initials.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getInitials({ +const result = avatars.getInitials({ name: '', // optional width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/console-web/examples/avatars/get-photo.md b/examples/2.0.x/console-web/examples/avatars/get-photo.md index 8c6bd8a90..1ca4ed7ef 100644 --- a/examples/2.0.x/console-web/examples/avatars/get-photo.md +++ b/examples/2.0.x/console-web/examples/avatars/get-photo.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getPhoto({ +const result = avatars.getPhoto({ width: 0, // optional height: 0, // optional quality: 0, // optional diff --git a/examples/2.0.x/console-web/examples/avatars/get-qr.md b/examples/2.0.x/console-web/examples/avatars/get-qr.md index 1618b2637..f64488416 100644 --- a/examples/2.0.x/console-web/examples/avatars/get-qr.md +++ b/examples/2.0.x/console-web/examples/avatars/get-qr.md @@ -7,7 +7,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getQR({ +const result = avatars.getQR({ text: '', size: 1, // optional margin: 0, // optional diff --git a/examples/2.0.x/console-web/examples/avatars/get-screenshot.md b/examples/2.0.x/console-web/examples/avatars/get-screenshot.md index 578a9e930..0869f5422 100644 --- a/examples/2.0.x/console-web/examples/avatars/get-screenshot.md +++ b/examples/2.0.x/console-web/examples/avatars/get-screenshot.md @@ -14,7 +14,7 @@ const client = new Client() const avatars = new Avatars(client); -const result = await avatars.getScreenshot({ +const result = avatars.getScreenshot({ url: 'https://example.com', headers: { Authorization: 'Bearer token123', diff --git a/examples/2.0.x/console-web/examples/functions/get-deployment-download.md b/examples/2.0.x/console-web/examples/functions/get-deployment-download.md index 907862fb2..632421467 100644 --- a/examples/2.0.x/console-web/examples/functions/get-deployment-download.md +++ b/examples/2.0.x/console-web/examples/functions/get-deployment-download.md @@ -11,7 +11,7 @@ const client = new Client() const functions = new Functions(client); -const result = await functions.getDeploymentDownload({ +const result = functions.getDeploymentDownload({ functionId: '', deploymentId: '', type: DeploymentDownloadType.Source, // optional diff --git a/examples/2.0.x/console-web/examples/organizations/get-invoice-download.md b/examples/2.0.x/console-web/examples/organizations/get-invoice-download.md index b96c41ced..0ace4a0dd 100644 --- a/examples/2.0.x/console-web/examples/organizations/get-invoice-download.md +++ b/examples/2.0.x/console-web/examples/organizations/get-invoice-download.md @@ -7,7 +7,7 @@ const client = new Client() const organizations = new Organizations(client); -const result = await organizations.getInvoiceDownload({ +const result = organizations.getInvoiceDownload({ organizationId: '', invoiceId: '', }); diff --git a/examples/2.0.x/console-web/examples/organizations/get-invoice-view.md b/examples/2.0.x/console-web/examples/organizations/get-invoice-view.md index a870c2f13..b499a545d 100644 --- a/examples/2.0.x/console-web/examples/organizations/get-invoice-view.md +++ b/examples/2.0.x/console-web/examples/organizations/get-invoice-view.md @@ -7,7 +7,7 @@ const client = new Client() const organizations = new Organizations(client); -const result = await organizations.getInvoiceView({ +const result = organizations.getInvoiceView({ organizationId: '', invoiceId: '', }); diff --git a/examples/2.0.x/console-web/examples/sites/get-deployment-download.md b/examples/2.0.x/console-web/examples/sites/get-deployment-download.md index 204072f34..308707875 100644 --- a/examples/2.0.x/console-web/examples/sites/get-deployment-download.md +++ b/examples/2.0.x/console-web/examples/sites/get-deployment-download.md @@ -7,7 +7,7 @@ const client = new Client() const sites = new Sites(client); -const result = await sites.getDeploymentDownload({ +const result = sites.getDeploymentDownload({ siteId: '', deploymentId: '', type: DeploymentDownloadType.Source, // optional diff --git a/examples/2.0.x/console-web/examples/storage/get-file-download.md b/examples/2.0.x/console-web/examples/storage/get-file-download.md index 7ff588052..6feab6e0a 100644 --- a/examples/2.0.x/console-web/examples/storage/get-file-download.md +++ b/examples/2.0.x/console-web/examples/storage/get-file-download.md @@ -7,7 +7,7 @@ const client = new Client() const storage = new Storage(client); -const result = await storage.getFileDownload({ +const result = storage.getFileDownload({ bucketId: '', fileId: '', token: '', // optional diff --git a/examples/2.0.x/console-web/examples/storage/get-file-preview.md b/examples/2.0.x/console-web/examples/storage/get-file-preview.md index 6a33c4703..b5d8f2dbb 100644 --- a/examples/2.0.x/console-web/examples/storage/get-file-preview.md +++ b/examples/2.0.x/console-web/examples/storage/get-file-preview.md @@ -12,12 +12,12 @@ const client = new Client() const storage = new Storage(client); -const result = await storage.getFilePreview({ +const result = storage.getFilePreview({ bucketId: '', fileId: '', width: 0, // optional height: 0, // optional - gravity: ImageGravity.Center, // optional + gravity: ImageGravity.Auto, // optional quality: -1, // optional borderWidth: 0, // optional borderColor: 'FFFFFF', // optional diff --git a/examples/2.0.x/console-web/examples/storage/get-file-view.md b/examples/2.0.x/console-web/examples/storage/get-file-view.md index abdcf91ca..7dea7751a 100644 --- a/examples/2.0.x/console-web/examples/storage/get-file-view.md +++ b/examples/2.0.x/console-web/examples/storage/get-file-view.md @@ -7,7 +7,7 @@ const client = new Client() const storage = new Storage(client); -const result = await storage.getFileView({ +const result = storage.getFileView({ bucketId: '', fileId: '', token: '', // optional diff --git a/examples/2.0.x/server-dart/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-dart/examples/account/create-o-auth-2-token.md index bf5437370..de299d60b 100644 --- a/examples/2.0.x/server-dart/examples/account/create-o-auth-2-token.md +++ b/examples/2.0.x/server-dart/examples/account/create-o-auth-2-token.md @@ -9,7 +9,7 @@ Client client = Client() Account account = Account(client); - result = await account.createOAuth2Token( +await account.createOAuth2Token( provider: enums.OAuthProvider.amazon, success: 'https://example.com', // (optional) failure: 'https://example.com', // (optional) diff --git a/examples/2.0.x/server-dart/examples/avatars/get-browser.md b/examples/2.0.x/server-dart/examples/avatars/get-browser.md index 6462606f0..b4626789b 100644 --- a/examples/2.0.x/server-dart/examples/avatars/get-browser.md +++ b/examples/2.0.x/server-dart/examples/avatars/get-browser.md @@ -9,7 +9,7 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getBrowser( +Uint8List result = await avatars.getBrowser( code: enums.Browser.avantBrowser, width: 0, // (optional) height: 0, // (optional) diff --git a/examples/2.0.x/server-dart/examples/avatars/get-credit-card.md b/examples/2.0.x/server-dart/examples/avatars/get-credit-card.md index 9a3671195..b5eb4f427 100644 --- a/examples/2.0.x/server-dart/examples/avatars/get-credit-card.md +++ b/examples/2.0.x/server-dart/examples/avatars/get-credit-card.md @@ -9,7 +9,7 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getCreditCard( +Uint8List result = await avatars.getCreditCard( code: enums.CreditCard.americanExpress, width: 0, // (optional) height: 0, // (optional) diff --git a/examples/2.0.x/server-dart/examples/avatars/get-favicon.md b/examples/2.0.x/server-dart/examples/avatars/get-favicon.md index 7e7692750..1bfa9b721 100644 --- a/examples/2.0.x/server-dart/examples/avatars/get-favicon.md +++ b/examples/2.0.x/server-dart/examples/avatars/get-favicon.md @@ -8,7 +8,7 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getFavicon( +Uint8List result = await avatars.getFavicon( url: 'https://example.com', ); ``` diff --git a/examples/2.0.x/server-dart/examples/avatars/get-flag.md b/examples/2.0.x/server-dart/examples/avatars/get-flag.md index 809ba1543..920ccc5d8 100644 --- a/examples/2.0.x/server-dart/examples/avatars/get-flag.md +++ b/examples/2.0.x/server-dart/examples/avatars/get-flag.md @@ -9,7 +9,7 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getFlag( +Uint8List result = await avatars.getFlag( code: enums.Flag.afghanistan, width: 0, // (optional) height: 0, // (optional) diff --git a/examples/2.0.x/server-dart/examples/avatars/get-image.md b/examples/2.0.x/server-dart/examples/avatars/get-image.md index f1788aece..c4c347102 100644 --- a/examples/2.0.x/server-dart/examples/avatars/get-image.md +++ b/examples/2.0.x/server-dart/examples/avatars/get-image.md @@ -8,7 +8,7 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getImage( +Uint8List result = await avatars.getImage( url: 'https://example.com', width: 0, // (optional) height: 0, // (optional) diff --git a/examples/2.0.x/server-dart/examples/avatars/get-initials.md b/examples/2.0.x/server-dart/examples/avatars/get-initials.md index 944f3c458..27323c5c9 100644 --- a/examples/2.0.x/server-dart/examples/avatars/get-initials.md +++ b/examples/2.0.x/server-dart/examples/avatars/get-initials.md @@ -8,7 +8,7 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getInitials( +Uint8List result = await avatars.getInitials( name: '', // (optional) width: 0, // (optional) height: 0, // (optional) diff --git a/examples/2.0.x/server-dart/examples/avatars/get-photo.md b/examples/2.0.x/server-dart/examples/avatars/get-photo.md index 83b5c83c8..9914fedcf 100644 --- a/examples/2.0.x/server-dart/examples/avatars/get-photo.md +++ b/examples/2.0.x/server-dart/examples/avatars/get-photo.md @@ -8,7 +8,7 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getPhoto( +Uint8List result = await avatars.getPhoto( width: 0, // (optional) height: 0, // (optional) quality: 0, // (optional) diff --git a/examples/2.0.x/server-dart/examples/avatars/get-qr.md b/examples/2.0.x/server-dart/examples/avatars/get-qr.md index 35c62fda5..9c470360e 100644 --- a/examples/2.0.x/server-dart/examples/avatars/get-qr.md +++ b/examples/2.0.x/server-dart/examples/avatars/get-qr.md @@ -8,7 +8,7 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getQR( +Uint8List result = await avatars.getQR( text: '', size: 1, // (optional) margin: 0, // (optional) diff --git a/examples/2.0.x/server-dart/examples/avatars/get-screenshot.md b/examples/2.0.x/server-dart/examples/avatars/get-screenshot.md index 0772bd077..b2c005e37 100644 --- a/examples/2.0.x/server-dart/examples/avatars/get-screenshot.md +++ b/examples/2.0.x/server-dart/examples/avatars/get-screenshot.md @@ -9,7 +9,7 @@ Client client = Client() Avatars avatars = Avatars(client); - result = await avatars.getScreenshot( +Uint8List result = await avatars.getScreenshot( url: 'https://example.com', headers: { "Authorization": "Bearer token123", diff --git a/examples/2.0.x/server-dart/examples/functions/create-deployment.md b/examples/2.0.x/server-dart/examples/functions/create-deployment.md index d9c5353f3..62ac7cca5 100644 --- a/examples/2.0.x/server-dart/examples/functions/create-deployment.md +++ b/examples/2.0.x/server-dart/examples/functions/create-deployment.md @@ -1,4 +1,5 @@ ```dart +import 'dart:io'; import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() diff --git a/examples/2.0.x/server-dart/examples/functions/get-deployment-download.md b/examples/2.0.x/server-dart/examples/functions/get-deployment-download.md index bc6f205e6..618f84b62 100644 --- a/examples/2.0.x/server-dart/examples/functions/get-deployment-download.md +++ b/examples/2.0.x/server-dart/examples/functions/get-deployment-download.md @@ -9,7 +9,7 @@ Client client = Client() Functions functions = Functions(client); - result = await functions.getDeploymentDownload( +Uint8List result = await functions.getDeploymentDownload( functionId: '', deploymentId: '', type: enums.DeploymentDownloadType.source, // (optional) diff --git a/examples/2.0.x/server-dart/examples/sites/create-deployment.md b/examples/2.0.x/server-dart/examples/sites/create-deployment.md index bd489271d..261c04fe9 100644 --- a/examples/2.0.x/server-dart/examples/sites/create-deployment.md +++ b/examples/2.0.x/server-dart/examples/sites/create-deployment.md @@ -1,4 +1,5 @@ ```dart +import 'dart:io'; import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() diff --git a/examples/2.0.x/server-dart/examples/sites/get-deployment-download.md b/examples/2.0.x/server-dart/examples/sites/get-deployment-download.md index 74a078a8f..412817491 100644 --- a/examples/2.0.x/server-dart/examples/sites/get-deployment-download.md +++ b/examples/2.0.x/server-dart/examples/sites/get-deployment-download.md @@ -9,7 +9,7 @@ Client client = Client() Sites sites = Sites(client); - result = await sites.getDeploymentDownload( +Uint8List result = await sites.getDeploymentDownload( siteId: '', deploymentId: '', type: enums.DeploymentDownloadType.source, // (optional) diff --git a/examples/2.0.x/server-dart/examples/storage/create-file.md b/examples/2.0.x/server-dart/examples/storage/create-file.md index a93f2b093..d0fae4cb8 100644 --- a/examples/2.0.x/server-dart/examples/storage/create-file.md +++ b/examples/2.0.x/server-dart/examples/storage/create-file.md @@ -1,4 +1,5 @@ ```dart +import 'dart:io'; import 'package:dart_appwrite/dart_appwrite.dart'; import 'package:dart_appwrite/permission.dart'; import 'package:dart_appwrite/role.dart'; diff --git a/examples/2.0.x/server-dart/examples/storage/get-file-download.md b/examples/2.0.x/server-dart/examples/storage/get-file-download.md index aa50a32a0..3eefb650e 100644 --- a/examples/2.0.x/server-dart/examples/storage/get-file-download.md +++ b/examples/2.0.x/server-dart/examples/storage/get-file-download.md @@ -8,7 +8,7 @@ Client client = Client() Storage storage = Storage(client); - result = await storage.getFileDownload( +Uint8List result = await storage.getFileDownload( bucketId: '', fileId: '', token: '', // (optional) diff --git a/examples/2.0.x/server-dart/examples/storage/get-file-preview.md b/examples/2.0.x/server-dart/examples/storage/get-file-preview.md index 0a7fb7475..3b5f44172 100644 --- a/examples/2.0.x/server-dart/examples/storage/get-file-preview.md +++ b/examples/2.0.x/server-dart/examples/storage/get-file-preview.md @@ -9,12 +9,12 @@ Client client = Client() Storage storage = Storage(client); - result = await storage.getFilePreview( +Uint8List result = await storage.getFilePreview( bucketId: '', fileId: '', width: 0, // (optional) height: 0, // (optional) - gravity: enums.ImageGravity.center, // (optional) + gravity: enums.ImageGravity.auto, // (optional) quality: -1, // (optional) borderWidth: 0, // (optional) borderColor: 'FFFFFF', // (optional) diff --git a/examples/2.0.x/server-dart/examples/storage/get-file-view.md b/examples/2.0.x/server-dart/examples/storage/get-file-view.md index 50bf050b8..63cd86995 100644 --- a/examples/2.0.x/server-dart/examples/storage/get-file-view.md +++ b/examples/2.0.x/server-dart/examples/storage/get-file-view.md @@ -8,7 +8,7 @@ Client client = Client() Storage storage = Storage(client); - result = await storage.getFileView( +Uint8List result = await storage.getFileView( bucketId: '', fileId: '', token: '', // (optional) diff --git a/examples/2.0.x/server-dotnet/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-dotnet/examples/account/create-o-auth-2-token.md index b2c59228c..f47f7e5ea 100644 --- a/examples/2.0.x/server-dotnet/examples/account/create-o-auth-2-token.md +++ b/examples/2.0.x/server-dotnet/examples/account/create-o-auth-2-token.md @@ -11,7 +11,7 @@ Client client = new Client() Account account = new Account(client); - result = await account.CreateOAuth2Token( +await account.CreateOAuth2Token( provider: OAuthProvider.Amazon, success: "https://example.com", // optional failure: "https://example.com", // optional diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-browser.md b/examples/2.0.x/server-dotnet/examples/avatars/get-browser.md index 58665aa6f..4b53a3e43 100644 --- a/examples/2.0.x/server-dotnet/examples/avatars/get-browser.md +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-browser.md @@ -11,7 +11,7 @@ Client client = new Client() Avatars avatars = new Avatars(client); - result = await avatars.GetBrowser( +byte[] result = await avatars.GetBrowser( code: Browser.AvantBrowser, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-credit-card.md b/examples/2.0.x/server-dotnet/examples/avatars/get-credit-card.md index 462b01598..924d4b6c0 100644 --- a/examples/2.0.x/server-dotnet/examples/avatars/get-credit-card.md +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-credit-card.md @@ -11,7 +11,7 @@ Client client = new Client() Avatars avatars = new Avatars(client); - result = await avatars.GetCreditCard( +byte[] result = await avatars.GetCreditCard( code: CreditCard.AmericanExpress, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-favicon.md b/examples/2.0.x/server-dotnet/examples/avatars/get-favicon.md index e9e40f4ec..d71797488 100644 --- a/examples/2.0.x/server-dotnet/examples/avatars/get-favicon.md +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-favicon.md @@ -10,7 +10,7 @@ Client client = new Client() Avatars avatars = new Avatars(client); - result = await avatars.GetFavicon( +byte[] result = await avatars.GetFavicon( url: "https://example.com" ); diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-flag.md b/examples/2.0.x/server-dotnet/examples/avatars/get-flag.md index 78f415a55..8480c6fb8 100644 --- a/examples/2.0.x/server-dotnet/examples/avatars/get-flag.md +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-flag.md @@ -11,7 +11,7 @@ Client client = new Client() Avatars avatars = new Avatars(client); - result = await avatars.GetFlag( +byte[] result = await avatars.GetFlag( code: Flag.Afghanistan, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-image.md b/examples/2.0.x/server-dotnet/examples/avatars/get-image.md index 54796c5ed..86ef67f7a 100644 --- a/examples/2.0.x/server-dotnet/examples/avatars/get-image.md +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-image.md @@ -10,7 +10,7 @@ Client client = new Client() Avatars avatars = new Avatars(client); - result = await avatars.GetImage( +byte[] result = await avatars.GetImage( url: "https://example.com", width: 0, // optional height: 0 // optional diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-initials.md b/examples/2.0.x/server-dotnet/examples/avatars/get-initials.md index 875d218bb..3c6d7dd16 100644 --- a/examples/2.0.x/server-dotnet/examples/avatars/get-initials.md +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-initials.md @@ -10,7 +10,7 @@ Client client = new Client() Avatars avatars = new Avatars(client); - result = await avatars.GetInitials( +byte[] result = await avatars.GetInitials( name: "", // optional width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-photo.md b/examples/2.0.x/server-dotnet/examples/avatars/get-photo.md index 602871c4d..0f65e5396 100644 --- a/examples/2.0.x/server-dotnet/examples/avatars/get-photo.md +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-photo.md @@ -10,7 +10,7 @@ Client client = new Client() Avatars avatars = new Avatars(client); - result = await avatars.GetPhoto( +byte[] result = await avatars.GetPhoto( width: 0, // optional height: 0, // optional quality: 0, // optional diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-qr.md b/examples/2.0.x/server-dotnet/examples/avatars/get-qr.md index d05b1993b..0be679e65 100644 --- a/examples/2.0.x/server-dotnet/examples/avatars/get-qr.md +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-qr.md @@ -10,7 +10,7 @@ Client client = new Client() Avatars avatars = new Avatars(client); - result = await avatars.GetQR( +byte[] result = await avatars.GetQR( text: "", size: 1, // optional margin: 0, // optional diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-screenshot.md b/examples/2.0.x/server-dotnet/examples/avatars/get-screenshot.md index 7aea98e26..92828bf71 100644 --- a/examples/2.0.x/server-dotnet/examples/avatars/get-screenshot.md +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-screenshot.md @@ -11,7 +11,7 @@ Client client = new Client() Avatars avatars = new Avatars(client); - result = await avatars.GetScreenshot( +byte[] result = await avatars.GetScreenshot( url: "https://example.com", headers: new { Authorization = "Bearer token123", diff --git a/examples/2.0.x/server-dotnet/examples/functions/get-deployment-download.md b/examples/2.0.x/server-dotnet/examples/functions/get-deployment-download.md index e1277e508..0756473ad 100644 --- a/examples/2.0.x/server-dotnet/examples/functions/get-deployment-download.md +++ b/examples/2.0.x/server-dotnet/examples/functions/get-deployment-download.md @@ -11,7 +11,7 @@ Client client = new Client() Functions functions = new Functions(client); - result = await functions.GetDeploymentDownload( +byte[] result = await functions.GetDeploymentDownload( functionId: "", deploymentId: "", type: DeploymentDownloadType.Source, // optional diff --git a/examples/2.0.x/server-dotnet/examples/sites/get-deployment-download.md b/examples/2.0.x/server-dotnet/examples/sites/get-deployment-download.md index 12855410d..e4f0985b6 100644 --- a/examples/2.0.x/server-dotnet/examples/sites/get-deployment-download.md +++ b/examples/2.0.x/server-dotnet/examples/sites/get-deployment-download.md @@ -11,7 +11,7 @@ Client client = new Client() Sites sites = new Sites(client); - result = await sites.GetDeploymentDownload( +byte[] result = await sites.GetDeploymentDownload( siteId: "", deploymentId: "", type: DeploymentDownloadType.Source, // optional diff --git a/examples/2.0.x/server-dotnet/examples/storage/get-file-download.md b/examples/2.0.x/server-dotnet/examples/storage/get-file-download.md index bcf7b44e7..0cb454752 100644 --- a/examples/2.0.x/server-dotnet/examples/storage/get-file-download.md +++ b/examples/2.0.x/server-dotnet/examples/storage/get-file-download.md @@ -10,7 +10,7 @@ Client client = new Client() Storage storage = new Storage(client); - result = await storage.GetFileDownload( +byte[] result = await storage.GetFileDownload( bucketId: "", fileId: "", token: "" // optional diff --git a/examples/2.0.x/server-dotnet/examples/storage/get-file-preview.md b/examples/2.0.x/server-dotnet/examples/storage/get-file-preview.md index e6f098a52..cf2667192 100644 --- a/examples/2.0.x/server-dotnet/examples/storage/get-file-preview.md +++ b/examples/2.0.x/server-dotnet/examples/storage/get-file-preview.md @@ -11,12 +11,12 @@ Client client = new Client() Storage storage = new Storage(client); - result = await storage.GetFilePreview( +byte[] result = await storage.GetFilePreview( bucketId: "", fileId: "", width: 0, // optional height: 0, // optional - gravity: ImageGravity.Center, // optional + gravity: ImageGravity.Auto, // optional quality: -1, // optional borderWidth: 0, // optional borderColor: "FFFFFF", // optional diff --git a/examples/2.0.x/server-dotnet/examples/storage/get-file-view.md b/examples/2.0.x/server-dotnet/examples/storage/get-file-view.md index 0558f1108..5639caef2 100644 --- a/examples/2.0.x/server-dotnet/examples/storage/get-file-view.md +++ b/examples/2.0.x/server-dotnet/examples/storage/get-file-view.md @@ -10,7 +10,7 @@ Client client = new Client() Storage storage = new Storage(client); - result = await storage.GetFileView( +byte[] result = await storage.GetFileView( bucketId: "", fileId: "", token: "" // optional diff --git a/examples/2.0.x/server-go/examples/storage/get-file-preview.md b/examples/2.0.x/server-go/examples/storage/get-file-preview.md index cea7bf2c1..2b7a583f0 100644 --- a/examples/2.0.x/server-go/examples/storage/get-file-preview.md +++ b/examples/2.0.x/server-go/examples/storage/get-file-preview.md @@ -22,7 +22,7 @@ func main() { "", service.WithGetFilePreviewWidth(0), service.WithGetFilePreviewHeight(0), - service.WithGetFilePreviewGravity("center"), + service.WithGetFilePreviewGravity("auto"), service.WithGetFilePreviewQuality(-1), service.WithGetFilePreviewBorderWidth(0), service.WithGetFilePreviewBorderColor("FFFFFF"), diff --git a/examples/2.0.x/server-graphql/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-graphql/examples/account/create-o-auth-2-token.md deleted file mode 100644 index c6c1f5d55..000000000 --- a/examples/2.0.x/server-graphql/examples/account/create-o-auth-2-token.md +++ /dev/null @@ -1,12 +0,0 @@ -```graphql -query { - accountCreateOAuth2Token( - provider: "amazon", - success: "https://example.com", - failure: "https://example.com", - scopes: [] - ) { - status - } -} -``` diff --git a/examples/2.0.x/server-graphql/examples/storage/get-file-preview.md b/examples/2.0.x/server-graphql/examples/storage/get-file-preview.md index d4cc5edf0..0c06ca2b8 100644 --- a/examples/2.0.x/server-graphql/examples/storage/get-file-preview.md +++ b/examples/2.0.x/server-graphql/examples/storage/get-file-preview.md @@ -5,7 +5,7 @@ query { fileId: "", width: 0, height: 0, - gravity: "center", + gravity: "auto", quality: -1, borderWidth: 0, borderColor: "FFFFFF", diff --git a/examples/2.0.x/server-kotlin/java/storage/get-file-preview.md b/examples/2.0.x/server-kotlin/java/storage/get-file-preview.md index eb69564dc..45be19a5a 100644 --- a/examples/2.0.x/server-kotlin/java/storage/get-file-preview.md +++ b/examples/2.0.x/server-kotlin/java/storage/get-file-preview.md @@ -17,7 +17,7 @@ storage.getFilePreview( "", // fileId 0, // width (optional) 0, // height (optional) - ImageGravity.CENTER, // gravity (optional) + ImageGravity.AUTO, // gravity (optional) -1, // quality (optional) 0, // borderWidth (optional) "FFFFFF", // borderColor (optional) diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-o-auth-2-token.md b/examples/2.0.x/server-kotlin/kotlin/account/create-o-auth-2-token.md index d81d07dac..bc993687d 100644 --- a/examples/2.0.x/server-kotlin/kotlin/account/create-o-auth-2-token.md +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-o-auth-2-token.md @@ -11,7 +11,7 @@ val client = Client() val account = Account(client) -val response = account.createOAuth2Token( +account.createOAuth2Token( provider = OAuthProvider.AMAZON, success = "https://example.com", // optional failure = "https://example.com", // optional diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-browser.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-browser.md index b88033f83..2565bd7cf 100644 --- a/examples/2.0.x/server-kotlin/kotlin/avatars/get-browser.md +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-browser.md @@ -11,7 +11,7 @@ val client = Client() val avatars = Avatars(client) -val response = avatars.getBrowser( +val result = avatars.getBrowser( code = Browser.AVANT_BROWSER, width = 0, // optional height = 0, // optional diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-credit-card.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-credit-card.md index 8247a61d5..08ce6f06c 100644 --- a/examples/2.0.x/server-kotlin/kotlin/avatars/get-credit-card.md +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-credit-card.md @@ -11,7 +11,7 @@ val client = Client() val avatars = Avatars(client) -val response = avatars.getCreditCard( +val result = avatars.getCreditCard( code = CreditCard.AMERICAN_EXPRESS, width = 0, // optional height = 0, // optional diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-favicon.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-favicon.md index b3bbdb5fc..b19ad3ffc 100644 --- a/examples/2.0.x/server-kotlin/kotlin/avatars/get-favicon.md +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-favicon.md @@ -10,7 +10,7 @@ val client = Client() val avatars = Avatars(client) -val response = avatars.getFavicon( +val result = avatars.getFavicon( url = "https://example.com" ) ``` diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-flag.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-flag.md index b679f6cdd..3f411c337 100644 --- a/examples/2.0.x/server-kotlin/kotlin/avatars/get-flag.md +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-flag.md @@ -11,7 +11,7 @@ val client = Client() val avatars = Avatars(client) -val response = avatars.getFlag( +val result = avatars.getFlag( code = Flag.AFGHANISTAN, width = 0, // optional height = 0, // optional diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-image.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-image.md index aa282b718..5efffd328 100644 --- a/examples/2.0.x/server-kotlin/kotlin/avatars/get-image.md +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-image.md @@ -10,7 +10,7 @@ val client = Client() val avatars = Avatars(client) -val response = avatars.getImage( +val result = avatars.getImage( url = "https://example.com", width = 0, // optional height = 0 // optional diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-initials.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-initials.md index f0eebb43d..32e7c4ffb 100644 --- a/examples/2.0.x/server-kotlin/kotlin/avatars/get-initials.md +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-initials.md @@ -10,7 +10,7 @@ val client = Client() val avatars = Avatars(client) -val response = avatars.getInitials( +val result = avatars.getInitials( name = "", // optional width = 0, // optional height = 0, // optional diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-photo.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-photo.md index 2533e91bf..6cd21327b 100644 --- a/examples/2.0.x/server-kotlin/kotlin/avatars/get-photo.md +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-photo.md @@ -10,7 +10,7 @@ val client = Client() val avatars = Avatars(client) -val response = avatars.getPhoto( +val result = avatars.getPhoto( width = 0, // optional height = 0, // optional quality = 0, // optional diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-qr.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-qr.md index d25151d7d..e9419fef5 100644 --- a/examples/2.0.x/server-kotlin/kotlin/avatars/get-qr.md +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-qr.md @@ -10,7 +10,7 @@ val client = Client() val avatars = Avatars(client) -val response = avatars.getQR( +val result = avatars.getQR( text = "", size = 1, // optional margin = 0, // optional diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-screenshot.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-screenshot.md index 0b82fe896..ea26656a8 100644 --- a/examples/2.0.x/server-kotlin/kotlin/avatars/get-screenshot.md +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-screenshot.md @@ -14,7 +14,7 @@ val client = Client() val avatars = Avatars(client) -val response = avatars.getScreenshot( +val result = avatars.getScreenshot( url = "https://example.com", headers = mapOf( "Authorization" to "Bearer token123", diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/get-deployment-download.md b/examples/2.0.x/server-kotlin/kotlin/functions/get-deployment-download.md index 138b3070b..bf7c03f1d 100644 --- a/examples/2.0.x/server-kotlin/kotlin/functions/get-deployment-download.md +++ b/examples/2.0.x/server-kotlin/kotlin/functions/get-deployment-download.md @@ -11,7 +11,7 @@ val client = Client() val functions = Functions(client) -val response = functions.getDeploymentDownload( +val result = functions.getDeploymentDownload( functionId = "", deploymentId = "", type = DeploymentDownloadType.SOURCE, // optional diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/get-deployment-download.md b/examples/2.0.x/server-kotlin/kotlin/sites/get-deployment-download.md index dd560e030..374e13764 100644 --- a/examples/2.0.x/server-kotlin/kotlin/sites/get-deployment-download.md +++ b/examples/2.0.x/server-kotlin/kotlin/sites/get-deployment-download.md @@ -11,7 +11,7 @@ val client = Client() val sites = Sites(client) -val response = sites.getDeploymentDownload( +val result = sites.getDeploymentDownload( siteId = "", deploymentId = "", type = DeploymentDownloadType.SOURCE, // optional diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/get-file-download.md b/examples/2.0.x/server-kotlin/kotlin/storage/get-file-download.md index 26dabc878..ed3198dde 100644 --- a/examples/2.0.x/server-kotlin/kotlin/storage/get-file-download.md +++ b/examples/2.0.x/server-kotlin/kotlin/storage/get-file-download.md @@ -10,7 +10,7 @@ val client = Client() val storage = Storage(client) -val response = storage.getFileDownload( +val result = storage.getFileDownload( bucketId = "", fileId = "", token = "" // optional diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/get-file-preview.md b/examples/2.0.x/server-kotlin/kotlin/storage/get-file-preview.md index 298602386..a9df2c0cf 100644 --- a/examples/2.0.x/server-kotlin/kotlin/storage/get-file-preview.md +++ b/examples/2.0.x/server-kotlin/kotlin/storage/get-file-preview.md @@ -12,12 +12,12 @@ val client = Client() val storage = Storage(client) -val response = storage.getFilePreview( +val result = storage.getFilePreview( bucketId = "", fileId = "", width = 0, // optional height = 0, // optional - gravity = ImageGravity.CENTER, // optional + gravity = ImageGravity.AUTO, // optional quality = -1, // optional borderWidth = 0, // optional borderColor = "FFFFFF", // optional diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/get-file-view.md b/examples/2.0.x/server-kotlin/kotlin/storage/get-file-view.md index b49e60777..141a8cd4f 100644 --- a/examples/2.0.x/server-kotlin/kotlin/storage/get-file-view.md +++ b/examples/2.0.x/server-kotlin/kotlin/storage/get-file-view.md @@ -10,7 +10,7 @@ val client = Client() val storage = Storage(client) -val response = storage.getFileView( +val result = storage.getFileView( bucketId = "", fileId = "", token = "" // optional diff --git a/examples/2.0.x/server-nodejs/examples/storage/get-file-preview.md b/examples/2.0.x/server-nodejs/examples/storage/get-file-preview.md index 5e13a0ba9..d3447ea2e 100644 --- a/examples/2.0.x/server-nodejs/examples/storage/get-file-preview.md +++ b/examples/2.0.x/server-nodejs/examples/storage/get-file-preview.md @@ -13,7 +13,7 @@ const result = await storage.getFilePreview({ fileId: '', width: 0, // optional height: 0, // optional - gravity: sdk.ImageGravity.Center, // optional + gravity: sdk.ImageGravity.Auto, // optional quality: -1, // optional borderWidth: 0, // optional borderColor: 'FFFFFF', // optional diff --git a/examples/2.0.x/server-php/examples/storage/get-file-preview.md b/examples/2.0.x/server-php/examples/storage/get-file-preview.md index a2960d66a..85cf889df 100644 --- a/examples/2.0.x/server-php/examples/storage/get-file-preview.md +++ b/examples/2.0.x/server-php/examples/storage/get-file-preview.md @@ -18,7 +18,7 @@ $result = $storage->getFilePreview( fileId: '', width: 0, // optional height: 0, // optional - gravity: ImageGravity::CENTER(), // optional + gravity: ImageGravity::AUTO(), // optional quality: -1, // optional borderWidth: 0, // optional borderColor: 'FFFFFF', // optional diff --git a/examples/2.0.x/server-python/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-python/examples/account/create-o-auth-2-token.md index 4ffa9ffbd..87f7de0f4 100644 --- a/examples/2.0.x/server-python/examples/account/create-o-auth-2-token.md +++ b/examples/2.0.x/server-python/examples/account/create-o-auth-2-token.md @@ -10,7 +10,7 @@ client.set_session('') # The user session to authenticate with account = Account(client) -result = account.create_o_auth2_token( +result: str = account.create_o_auth2_token( provider = OAuthProvider.AMAZON, success = 'https://example.com', # optional failure = 'https://example.com', # optional diff --git a/examples/2.0.x/server-python/examples/avatars/get-browser.md b/examples/2.0.x/server-python/examples/avatars/get-browser.md index 4e5b7a1b6..3c950dbb8 100644 --- a/examples/2.0.x/server-python/examples/avatars/get-browser.md +++ b/examples/2.0.x/server-python/examples/avatars/get-browser.md @@ -10,7 +10,7 @@ client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_browser( +result: bytes = avatars.get_browser( code = Browser.AVANT_BROWSER, width = 0, # optional height = 0, # optional diff --git a/examples/2.0.x/server-python/examples/avatars/get-credit-card.md b/examples/2.0.x/server-python/examples/avatars/get-credit-card.md index 587291572..8ef04f635 100644 --- a/examples/2.0.x/server-python/examples/avatars/get-credit-card.md +++ b/examples/2.0.x/server-python/examples/avatars/get-credit-card.md @@ -10,7 +10,7 @@ client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_credit_card( +result: bytes = avatars.get_credit_card( code = CreditCard.AMERICAN_EXPRESS, width = 0, # optional height = 0, # optional diff --git a/examples/2.0.x/server-python/examples/avatars/get-favicon.md b/examples/2.0.x/server-python/examples/avatars/get-favicon.md index b201146c5..dd234eafc 100644 --- a/examples/2.0.x/server-python/examples/avatars/get-favicon.md +++ b/examples/2.0.x/server-python/examples/avatars/get-favicon.md @@ -9,7 +9,7 @@ client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_favicon( +result: bytes = avatars.get_favicon( url = 'https://example.com' ) ``` diff --git a/examples/2.0.x/server-python/examples/avatars/get-flag.md b/examples/2.0.x/server-python/examples/avatars/get-flag.md index 2bd0776a1..f97b20dd8 100644 --- a/examples/2.0.x/server-python/examples/avatars/get-flag.md +++ b/examples/2.0.x/server-python/examples/avatars/get-flag.md @@ -10,7 +10,7 @@ client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_flag( +result: bytes = avatars.get_flag( code = Flag.AFGHANISTAN, width = 0, # optional height = 0, # optional diff --git a/examples/2.0.x/server-python/examples/avatars/get-image.md b/examples/2.0.x/server-python/examples/avatars/get-image.md index fa013f1a6..9beea030e 100644 --- a/examples/2.0.x/server-python/examples/avatars/get-image.md +++ b/examples/2.0.x/server-python/examples/avatars/get-image.md @@ -9,7 +9,7 @@ client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_image( +result: bytes = avatars.get_image( url = 'https://example.com', width = 0, # optional height = 0 # optional diff --git a/examples/2.0.x/server-python/examples/avatars/get-initials.md b/examples/2.0.x/server-python/examples/avatars/get-initials.md index 50e4b9e29..08788555e 100644 --- a/examples/2.0.x/server-python/examples/avatars/get-initials.md +++ b/examples/2.0.x/server-python/examples/avatars/get-initials.md @@ -9,7 +9,7 @@ client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_initials( +result: bytes = avatars.get_initials( name = '', # optional width = 0, # optional height = 0, # optional diff --git a/examples/2.0.x/server-python/examples/avatars/get-photo.md b/examples/2.0.x/server-python/examples/avatars/get-photo.md index 941c6a616..64cdf309e 100644 --- a/examples/2.0.x/server-python/examples/avatars/get-photo.md +++ b/examples/2.0.x/server-python/examples/avatars/get-photo.md @@ -9,7 +9,7 @@ client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_photo( +result: bytes = avatars.get_photo( width = 0, # optional height = 0, # optional quality = 0, # optional diff --git a/examples/2.0.x/server-python/examples/avatars/get-qr.md b/examples/2.0.x/server-python/examples/avatars/get-qr.md index f3dbede1e..a7968e75c 100644 --- a/examples/2.0.x/server-python/examples/avatars/get-qr.md +++ b/examples/2.0.x/server-python/examples/avatars/get-qr.md @@ -9,7 +9,7 @@ client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_qr( +result: bytes = avatars.get_qr( text = '', size = 1, # optional margin = 0, # optional diff --git a/examples/2.0.x/server-python/examples/avatars/get-screenshot.md b/examples/2.0.x/server-python/examples/avatars/get-screenshot.md index 67e697569..cf7f9a6b4 100644 --- a/examples/2.0.x/server-python/examples/avatars/get-screenshot.md +++ b/examples/2.0.x/server-python/examples/avatars/get-screenshot.md @@ -13,7 +13,7 @@ client.set_session('') # The user session to authenticate with avatars = Avatars(client) -result = avatars.get_screenshot( +result: bytes = avatars.get_screenshot( url = 'https://example.com', headers = { "Authorization": "Bearer token123", diff --git a/examples/2.0.x/server-python/examples/functions/get-deployment-download.md b/examples/2.0.x/server-python/examples/functions/get-deployment-download.md index 4ddffb445..49df861b2 100644 --- a/examples/2.0.x/server-python/examples/functions/get-deployment-download.md +++ b/examples/2.0.x/server-python/examples/functions/get-deployment-download.md @@ -10,7 +10,7 @@ client.set_key('') # Your secret API key functions = Functions(client) -result = functions.get_deployment_download( +result: bytes = functions.get_deployment_download( function_id = '', deployment_id = '', type = DeploymentDownloadType.SOURCE, # optional diff --git a/examples/2.0.x/server-python/examples/sites/get-deployment-download.md b/examples/2.0.x/server-python/examples/sites/get-deployment-download.md index c3c1fa1a2..7d6ae537d 100644 --- a/examples/2.0.x/server-python/examples/sites/get-deployment-download.md +++ b/examples/2.0.x/server-python/examples/sites/get-deployment-download.md @@ -10,7 +10,7 @@ client.set_key('') # Your secret API key sites = Sites(client) -result = sites.get_deployment_download( +result: bytes = sites.get_deployment_download( site_id = '', deployment_id = '', type = DeploymentDownloadType.SOURCE, # optional diff --git a/examples/2.0.x/server-python/examples/storage/get-file-download.md b/examples/2.0.x/server-python/examples/storage/get-file-download.md index 790bd7267..ac6f9424d 100644 --- a/examples/2.0.x/server-python/examples/storage/get-file-download.md +++ b/examples/2.0.x/server-python/examples/storage/get-file-download.md @@ -9,7 +9,7 @@ client.set_session('') # The user session to authenticate with storage = Storage(client) -result = storage.get_file_download( +result: bytes = storage.get_file_download( bucket_id = '', file_id = '', token = '' # optional diff --git a/examples/2.0.x/server-python/examples/storage/get-file-preview.md b/examples/2.0.x/server-python/examples/storage/get-file-preview.md index 1e0d64e3d..779153103 100644 --- a/examples/2.0.x/server-python/examples/storage/get-file-preview.md +++ b/examples/2.0.x/server-python/examples/storage/get-file-preview.md @@ -11,12 +11,12 @@ client.set_session('') # The user session to authenticate with storage = Storage(client) -result = storage.get_file_preview( +result: bytes = storage.get_file_preview( bucket_id = '', file_id = '', width = 0, # optional height = 0, # optional - gravity = ImageGravity.CENTER, # optional + gravity = ImageGravity.AUTO, # optional quality = -1, # optional border_width = 0, # optional border_color = 'FFFFFF', # optional diff --git a/examples/2.0.x/server-python/examples/storage/get-file-view.md b/examples/2.0.x/server-python/examples/storage/get-file-view.md index f78822d2d..5cceef6ff 100644 --- a/examples/2.0.x/server-python/examples/storage/get-file-view.md +++ b/examples/2.0.x/server-python/examples/storage/get-file-view.md @@ -9,7 +9,7 @@ client.set_session('') # The user session to authenticate with storage = Storage(client) -result = storage.get_file_view( +result: bytes = storage.get_file_view( bucket_id = '', file_id = '', token = '' # optional diff --git a/examples/2.0.x/server-rest/examples/graphql/mutation.md b/examples/2.0.x/server-rest/examples/graphql/mutation.md index 6f40a9985..a51586e9d 100644 --- a/examples/2.0.x/server-rest/examples/graphql/mutation.md +++ b/examples/2.0.x/server-rest/examples/graphql/mutation.md @@ -1,6 +1,7 @@ ```http POST /v1/graphql/mutation HTTP/1.1 Host: cloud.appwrite.io +X-Sdk-Graphql: true Content-Type: application/json Accept: application/json X-Appwrite-Response-Format: 2.0.0 diff --git a/examples/2.0.x/server-rest/examples/graphql/query.md b/examples/2.0.x/server-rest/examples/graphql/query.md index e133f3bc3..5029a563a 100644 --- a/examples/2.0.x/server-rest/examples/graphql/query.md +++ b/examples/2.0.x/server-rest/examples/graphql/query.md @@ -1,6 +1,7 @@ ```http POST /v1/graphql HTTP/1.1 Host: cloud.appwrite.io +X-Sdk-Graphql: true Content-Type: application/json Accept: application/json X-Appwrite-Response-Format: 2.0.0 diff --git a/examples/2.0.x/server-ruby/examples/storage/get-file-preview.md b/examples/2.0.x/server-ruby/examples/storage/get-file-preview.md index 3b4ce03db..d40c3a5e8 100644 --- a/examples/2.0.x/server-ruby/examples/storage/get-file-preview.md +++ b/examples/2.0.x/server-ruby/examples/storage/get-file-preview.md @@ -16,7 +16,7 @@ result = storage.get_file_preview( file_id: '', width: 0, # optional height: 0, # optional - gravity: ImageGravity::CENTER, # optional + gravity: ImageGravity::AUTO, # optional quality: -1, # optional border_width: 0, # optional border_color: 'FFFFFF', # optional diff --git a/examples/2.0.x/server-rust/examples/storage/get-file-preview.md b/examples/2.0.x/server-rust/examples/storage/get-file-preview.md index f8f2406d9..3246e90fa 100644 --- a/examples/2.0.x/server-rust/examples/storage/get-file-preview.md +++ b/examples/2.0.x/server-rust/examples/storage/get-file-preview.md @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box> { "", Some(0), // optional Some(0), // optional - Some(appwrite::enums::ImageGravity::Center), // optional + Some(appwrite::enums::ImageGravity::Auto), // optional Some(-1), // optional Some(0), // optional Some("FFFFFF"), // optional diff --git a/examples/2.0.x/server-swift/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-swift/examples/account/create-o-auth-2-token.md index 82ef0a5e1..b33820893 100644 --- a/examples/2.0.x/server-swift/examples/account/create-o-auth-2-token.md +++ b/examples/2.0.x/server-swift/examples/account/create-o-auth-2-token.md @@ -9,7 +9,7 @@ let client = Client() let account = Account(client) -let result = try await account.createOAuth2Token( +let success = try await account.createOAuth2Token( provider: .amazon, success: "https://example.com", // optional failure: "https://example.com", // optional diff --git a/examples/2.0.x/server-swift/examples/avatars/get-browser.md b/examples/2.0.x/server-swift/examples/avatars/get-browser.md index 9a4e86fc7..324540b47 100644 --- a/examples/2.0.x/server-swift/examples/avatars/get-browser.md +++ b/examples/2.0.x/server-swift/examples/avatars/get-browser.md @@ -9,7 +9,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getBrowser( +let bytes = try await avatars.getBrowser( code: .avantBrowser, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/server-swift/examples/avatars/get-credit-card.md b/examples/2.0.x/server-swift/examples/avatars/get-credit-card.md index 41a592191..45b7d4bef 100644 --- a/examples/2.0.x/server-swift/examples/avatars/get-credit-card.md +++ b/examples/2.0.x/server-swift/examples/avatars/get-credit-card.md @@ -9,7 +9,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getCreditCard( +let bytes = try await avatars.getCreditCard( code: .americanExpress, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/server-swift/examples/avatars/get-favicon.md b/examples/2.0.x/server-swift/examples/avatars/get-favicon.md index 0999d9a04..f0945dcaf 100644 --- a/examples/2.0.x/server-swift/examples/avatars/get-favicon.md +++ b/examples/2.0.x/server-swift/examples/avatars/get-favicon.md @@ -8,7 +8,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getFavicon( +let bytes = try await avatars.getFavicon( url: "https://example.com" ) diff --git a/examples/2.0.x/server-swift/examples/avatars/get-flag.md b/examples/2.0.x/server-swift/examples/avatars/get-flag.md index fcec16fb2..d7cc8c6ab 100644 --- a/examples/2.0.x/server-swift/examples/avatars/get-flag.md +++ b/examples/2.0.x/server-swift/examples/avatars/get-flag.md @@ -9,7 +9,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getFlag( +let bytes = try await avatars.getFlag( code: .afghanistan, width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/server-swift/examples/avatars/get-image.md b/examples/2.0.x/server-swift/examples/avatars/get-image.md index c5b4bd722..4f18af5a2 100644 --- a/examples/2.0.x/server-swift/examples/avatars/get-image.md +++ b/examples/2.0.x/server-swift/examples/avatars/get-image.md @@ -8,7 +8,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getImage( +let bytes = try await avatars.getImage( url: "https://example.com", width: 0, // optional height: 0 // optional diff --git a/examples/2.0.x/server-swift/examples/avatars/get-initials.md b/examples/2.0.x/server-swift/examples/avatars/get-initials.md index 29623cde8..b4e902277 100644 --- a/examples/2.0.x/server-swift/examples/avatars/get-initials.md +++ b/examples/2.0.x/server-swift/examples/avatars/get-initials.md @@ -8,7 +8,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getInitials( +let bytes = try await avatars.getInitials( name: "", // optional width: 0, // optional height: 0, // optional diff --git a/examples/2.0.x/server-swift/examples/avatars/get-photo.md b/examples/2.0.x/server-swift/examples/avatars/get-photo.md index 5e6c1c7cc..29ea9fa5d 100644 --- a/examples/2.0.x/server-swift/examples/avatars/get-photo.md +++ b/examples/2.0.x/server-swift/examples/avatars/get-photo.md @@ -8,7 +8,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getPhoto( +let bytes = try await avatars.getPhoto( width: 0, // optional height: 0, // optional quality: 0, // optional diff --git a/examples/2.0.x/server-swift/examples/avatars/get-qr.md b/examples/2.0.x/server-swift/examples/avatars/get-qr.md index 53f057e06..c5bfa168e 100644 --- a/examples/2.0.x/server-swift/examples/avatars/get-qr.md +++ b/examples/2.0.x/server-swift/examples/avatars/get-qr.md @@ -8,7 +8,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getQR( +let bytes = try await avatars.getQR( text: "", size: 1, // optional margin: 0, // optional diff --git a/examples/2.0.x/server-swift/examples/avatars/get-screenshot.md b/examples/2.0.x/server-swift/examples/avatars/get-screenshot.md index 00c22706a..482905ea9 100644 --- a/examples/2.0.x/server-swift/examples/avatars/get-screenshot.md +++ b/examples/2.0.x/server-swift/examples/avatars/get-screenshot.md @@ -9,7 +9,7 @@ let client = Client() let avatars = Avatars(client) -let result = try await avatars.getScreenshot( +let bytes = try await avatars.getScreenshot( url: "https://example.com", headers: [ "Authorization": "Bearer token123", diff --git a/examples/2.0.x/server-swift/examples/functions/get-deployment-download.md b/examples/2.0.x/server-swift/examples/functions/get-deployment-download.md index c3d62f2c9..6d3674e3f 100644 --- a/examples/2.0.x/server-swift/examples/functions/get-deployment-download.md +++ b/examples/2.0.x/server-swift/examples/functions/get-deployment-download.md @@ -9,7 +9,7 @@ let client = Client() let functions = Functions(client) -let result = try await functions.getDeploymentDownload( +let bytes = try await functions.getDeploymentDownload( functionId: "", deploymentId: "", type: .source, // optional diff --git a/examples/2.0.x/server-swift/examples/sites/get-deployment-download.md b/examples/2.0.x/server-swift/examples/sites/get-deployment-download.md index 4aca244ed..d3e391ccd 100644 --- a/examples/2.0.x/server-swift/examples/sites/get-deployment-download.md +++ b/examples/2.0.x/server-swift/examples/sites/get-deployment-download.md @@ -9,7 +9,7 @@ let client = Client() let sites = Sites(client) -let result = try await sites.getDeploymentDownload( +let bytes = try await sites.getDeploymentDownload( siteId: "", deploymentId: "", type: .source, // optional diff --git a/examples/2.0.x/server-swift/examples/storage/get-file-download.md b/examples/2.0.x/server-swift/examples/storage/get-file-download.md index 202ee9749..2efb755f7 100644 --- a/examples/2.0.x/server-swift/examples/storage/get-file-download.md +++ b/examples/2.0.x/server-swift/examples/storage/get-file-download.md @@ -8,7 +8,7 @@ let client = Client() let storage = Storage(client) -let result = try await storage.getFileDownload( +let bytes = try await storage.getFileDownload( bucketId: "", fileId: "", token: "" // optional diff --git a/examples/2.0.x/server-swift/examples/storage/get-file-preview.md b/examples/2.0.x/server-swift/examples/storage/get-file-preview.md index 6a99a9466..2b10c805f 100644 --- a/examples/2.0.x/server-swift/examples/storage/get-file-preview.md +++ b/examples/2.0.x/server-swift/examples/storage/get-file-preview.md @@ -9,12 +9,12 @@ let client = Client() let storage = Storage(client) -let result = try await storage.getFilePreview( +let bytes = try await storage.getFilePreview( bucketId: "", fileId: "", width: 0, // optional height: 0, // optional - gravity: .center, // optional + gravity: .auto, // optional quality: -1, // optional borderWidth: 0, // optional borderColor: "FFFFFF", // optional diff --git a/examples/2.0.x/server-swift/examples/storage/get-file-view.md b/examples/2.0.x/server-swift/examples/storage/get-file-view.md index 6e5fe18cb..df514f7e4 100644 --- a/examples/2.0.x/server-swift/examples/storage/get-file-view.md +++ b/examples/2.0.x/server-swift/examples/storage/get-file-view.md @@ -8,7 +8,7 @@ let client = Client() let storage = Storage(client) -let result = try await storage.getFileView( +let bytes = try await storage.getFileView( bucketId: "", fileId: "", token: "" // optional diff --git a/specs/2.0.x/open-api3-2.0.x.json b/specs/2.0.x/open-api3-2.0.x.json index 58c1f2386..7a01ddd5f 100644 --- a/specs/2.0.x/open-api3-2.0.x.json +++ b/specs/2.0.x/open-api3-2.0.x.json @@ -9073,7 +9073,7 @@ "type": "object", "properties": { "labels": { - "description": "Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "description": "Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. Reserved labels are rejected.", "type": "array", "items": { "type": "string" @@ -31822,7 +31822,7 @@ "tags": [ "domains" ], - "description": "Check availability and get the registration price for one or more domain names. Availability is resolved for all domains in a single registrar lookup. A domain whose price could not be resolved, for example because its TLD is not supported, is returned with a null price.", + "description": "Check availability and get the requested registration price for one or more domain names. Availability is resolved for all domains in a single registrar lookup. Unavailable domains have a null price for new registrations, but can still be priced for renewal, transfer, or trade. Every priced domain also carries its renewal price for the same period, so a separate renewal lookup is not needed. A domain whose price could not be resolved, for example because its TLD is not supported, is returned with a null price.", "responses": { "200": { "description": "Domain prices list", @@ -31839,7 +31839,7 @@ "x-appwrite": { "group": null, "demo": "domains\/list-prices.md", - "rate-limit": 50, + "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", "scope": "domains.read", @@ -36694,6 +36694,13 @@ ], "title": "dart-3.12" }, + { + "type": "string", + "enum": [ + "dart-3.13" + ], + "title": "dart-3.13" + }, { "type": "string", "enum": [ @@ -36987,6 +36994,13 @@ "flutter-3.44" ], "title": "flutter-3.44" + }, + { + "type": "string", + "enum": [ + "flutter-3.47" + ], + "title": "flutter-3.47" } ] }, @@ -38531,6 +38545,13 @@ ], "title": "dart-3.12" }, + { + "type": "string", + "enum": [ + "dart-3.13" + ], + "title": "dart-3.13" + }, { "type": "string", "enum": [ @@ -38824,6 +38845,13 @@ "flutter-3.44" ], "title": "flutter-3.44" + }, + { + "type": "string", + "enum": [ + "flutter-3.47" + ], + "title": "flutter-3.47" } ] }, @@ -39512,6 +39540,13 @@ ], "title": "dart-3.12" }, + { + "type": "string", + "enum": [ + "dart-3.13" + ], + "title": "dart-3.13" + }, { "type": "string", "enum": [ @@ -39805,6 +39840,13 @@ "flutter-3.44" ], "title": "flutter-3.44" + }, + { + "type": "string", + "enum": [ + "flutter-3.47" + ], + "title": "flutter-3.47" } ] }, @@ -64817,11 +64859,12 @@ "description": "Download invoice in PDF", "responses": { "200": { - "description": "paymentMethod", + "description": "File", "content": { - "application\/json": { + "*\/*": { "schema": { - "$ref": "#\/components\/schemas\/paymentMethod" + "type": "string", + "format": "binary" } } } @@ -65042,11 +65085,12 @@ "description": "View invoice in PDF", "responses": { "200": { - "description": "paymentMethod", + "description": "File", "content": { - "application\/json": { + "*\/*": { "schema": { - "$ref": "#\/components\/schemas\/paymentMethod" + "type": "string", + "format": "binary" } } } @@ -88067,6 +88111,13 @@ ], "title": "dart-3.12" }, + { + "type": "string", + "enum": [ + "dart-3.13" + ], + "title": "dart-3.13" + }, { "type": "string", "enum": [ @@ -88360,6 +88411,13 @@ "flutter-3.44" ], "title": "flutter-3.44" + }, + { + "type": "string", + "enum": [ + "flutter-3.47" + ], + "title": "flutter-3.47" } ] }, @@ -90451,6 +90509,13 @@ ], "title": "dart-3.12" }, + { + "type": "string", + "enum": [ + "dart-3.13" + ], + "title": "dart-3.13" + }, { "type": "string", "enum": [ @@ -90744,6 +90809,13 @@ "flutter-3.44" ], "title": "flutter-3.44" + }, + { + "type": "string", + "enum": [ + "flutter-3.47" + ], + "title": "flutter-3.47" } ] }, @@ -94602,13 +94674,20 @@ }, { "name": "gravity", - "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "description": "Image crop gravity. Can be one of auto,center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", "required": false, "schema": { "type": "string", - "example": "center", + "example": "auto", "title": "ImageGravity", "oneOf": [ + { + "type": "string", + "enum": [ + "auto" + ], + "title": "auto" + }, { "type": "string", "enum": [ @@ -142401,6 +142480,19 @@ "type": "boolean", "description": "Whether the domain is a premium domain.", "example": false + }, + "renewalPrice": { + "type": "number", + "description": "Domain renewal price for the same period. Null when the domain was not priced or the registrar has no renewal price for it.", + "format": "double", + "example": 27.99, + "nullable": true + }, + "renewalPeriodYears": { + "type": "integer", + "description": "Renewal price period in years.", + "format": "int32", + "example": 1 } }, "required": [ @@ -142408,7 +142500,8 @@ "tld", "available", "periodYears", - "premium" + "premium", + "renewalPeriodYears" ], "example": { "domain": "example.com", @@ -142416,7 +142509,9 @@ "available": true, "price": 25.99, "periodYears": 1, - "premium": false + "premium": false, + "renewalPrice": 27.99, + "renewalPeriodYears": 1 } }, "domainPurchase": {