diff --git a/.gitignore b/.gitignore index 7342b12..b8309fb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules .idea .vscode .env +venv \ No newline at end of file diff --git a/docs/4eeb7d58-4583-11ee-9922-f2ea36f81204.json b/docs/4eeb7d58-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..cd77dad --- /dev/null +++ b/docs/4eeb7d58-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs"}} \ No newline at end of file diff --git a/docs/4eeb9216-4583-11ee-9922-f2ea36f81204.json b/docs/4eeb9216-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..66c0bef --- /dev/null +++ b/docs/4eeb9216-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Overview \", \"body\": [\"Appwrite is an end-to-end backend server that is aiming to abstract the complexity of common, complex, and repetitive tasks required for building a modern app.\", \"Appwrite provides you with a set of APIs, tools, and a management console UI to help you build your apps a lot faster and in a much more secure way. Between Appwrite different services, you can find user authentication and account management, user preferences, database and storage persistence, cloud functions, localization, image manipulation, and more.\"]}, {\"level\": 3, \"title\": \"Appwrite is Cross-Platform\", \"body\": [\"Appwrite is both cross-platform and technology agnostic, meaning it can run on any operating system, coding language, or platform. Although Appwrite can easily fit the definition of serverless technology, it's designed to run well in multiple configurations. You can integrate Appwrite directly with your client app, use it behind your custom backend or alongside your backend server.\", \"There are many cases where Appwrite can be used as an alternative to your custom backend server, but it doesn't purport to replace your backend engineers. It would be best if you thought of Appwrite as a tool at your disposal that you can combine into your stack any way you see fit.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/overview"}} \ No newline at end of file diff --git a/docs/ee43850a-1f0c-11ee-98fa-00155da08df7.json b/docs/4eeb9b80-4583-11ee-9922-f2ea36f81204.json similarity index 97% rename from docs/ee43850a-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eeb9b80-4583-11ee-9922-f2ea36f81204.json index d3ad68d..6387112 100644 --- a/docs/ee43850a-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eeb9b80-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Getting Started for Web \", \"body\": [\"Appwrite is a development platform that provides a powerful API and management console to get your next project up and running quickly.\", \"Create your first project now and start building on Appwrite Cloud.\"]}, {\"level\": 2, \"title\": \"Add Your Web Platform\", \"body\": [\"To init your SDK and interact with Appwrite services, you need to add a web platform to your project. To add a new platform, go to your Appwrite console, choose the project you created in the step before and click the 'Add Platform' button.\", \"From the options, choose to add a web platform and add your client app hostname. By adding your hostname to your project platform, you are allowing cross-domain communication between your project and the Appwrite API. Only web apps hosted on domains specified in a web platform will be able to make requests to your Appwrite instance, preventing unwanted access from malicious actors.\", \"Web platforms allow wildcard hostnames through a * character. The wildcard character can be applied anywhere in a hostname, both *.example.com and prod.*.example.com are valid examples. Avoid using wildcards unless necessary to keep your Appwrite project secure.\"]}, {\"level\": 2, \"title\": \"Get Appwrite Web SDK\", \"body\": []}, {\"level\": 3, \"title\": \"NPM\", \"body\": [\"Use NPM (node package manager) from your command line to add Appwrite SDK to your project.\", \" npm install appwrite\", \"When you're using a bundler (like Browserify or Webpack), import the Appwrite module when you need it:\", \" import { Client, Account, ID } from 'appwrite';\"]}, {\"level\": 3, \"title\": \"CDN\", \"body\": [\"To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services:\", \" \\n\"]}, {\"level\": 2, \"title\": \"Init your SDK\", \"body\": [\"Initialize your SDK code with your project ID which can be found in your project settings page.\", \" const client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\"]}, {\"level\": 2, \"title\": \"Make Your First Request\", \"body\": [\"After your SDK configuration is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would use is found in the SDK documentation or in the API References section.\", \" const account = new Account(client);\\n\\n// Register User\\naccount.create(\\n ID.unique(),\\n 'me@example.com',\\n 'password',\\n 'Jane Doe'\\n).then(response => {\\n console.log(response);\\n}, error => {\\n console.log(error);\\n});\"]}, {\"level\": 2, \"title\": \"Listen to Changes\", \"body\": [\"To listen to changes in realtime from Appwrite, subscribe to a variety of channels and receive updates within milliseconds. Full documentation for Realtime is found here.\", \" // Subscribe to files channel\\nclient.subscribe('files', response => {\\n if(response.events.includes('buckets.*.files.*.create')) {\\n // Log when a new file is uploaded\\n console.log(response.payload);\\n }\\n});\"]}, {\"level\": 2, \"title\": \"Full Example\", \"body\": [\" import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\n// Register User\\naccount.create(\\n ID.unique(),\\n 'me@example.com',\\n 'password',\\n 'Jane Doe'\\n).then(response => {\\n console.log(response);\\n}, error => {\\n console.log(error);\\n});\\n\\n// Subscribe to files channel\\nclient.subscribe('files', response => {\\n if(response.events.includes('buckets.*.files.*.create')) {\\n // Log when a new file is uploaded\\n console.log(response.payload);\\n }\\n});\"]}, {\"level\": 2, \"title\": \"Demos\", \"body\": [\"Below is a list of some demos to help you get started with Appwrite for Web using your favorite tools and framework of choice.\", \" Demo GitHub Repository Todo App with React JS appwrite/todo-with-react Live Example Todo App with Vue JS appwrite/todo-with-vue Live Example Todo App with Angular appwrite/todo-with-angular Live Example Todo App with Svelte appwrite/todo-with-svelte Live Example \"]}]", "metadata": {"source": "https://appwrite.io/docs/getting-started-for-web"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Getting Started for Web \", \"body\": [\"Appwrite is a development platform that provides a powerful API and management console to get your next project up and running quickly.\", \"Create your first project now and start building on Appwrite Cloud.\"]}, {\"level\": 2, \"title\": \"Add Your Web Platform\", \"body\": [\"To init your SDK and interact with Appwrite services, you need to add a web platform to your project. To add a new platform, go to your Appwrite Console, choose the project you created in the step before and click the 'Add Platform' button.\", \"From the options, choose to add a web platform and add your client app hostname. By adding your hostname to your project platform, you are allowing cross-domain communication between your project and the Appwrite API. Only web apps hosted on domains specified in a web platform will be able to make requests to your Appwrite instance, preventing unwanted access from malicious actors.\", \"Web platforms allow wildcard hostnames through a * character. The wildcard character can be applied anywhere in a hostname, both *.example.com and prod.*.example.com are valid examples. Avoid using wildcards unless necessary to keep your Appwrite project secure.\"]}, {\"level\": 2, \"title\": \"Get Appwrite Web SDK\", \"body\": []}, {\"level\": 3, \"title\": \"NPM\", \"body\": [\"Use NPM (node package manager) from your command line to add Appwrite SDK to your project.\", \" npm install appwrite\", \"When you're using a bundler (like Browserify or Webpack), import the Appwrite module when you need it:\", \" import { Client, Account, ID } from 'appwrite';\"]}, {\"level\": 3, \"title\": \"CDN\", \"body\": [\"To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services:\", \" \\n\"]}, {\"level\": 2, \"title\": \"Init your SDK\", \"body\": [\"Initialize your SDK code with your project ID which can be found in your project settings page.\", \" const client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\"]}, {\"level\": 2, \"title\": \"Make Your First Request\", \"body\": [\"After your SDK configuration is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would use is found in the SDK documentation or in the API References section.\", \" const account = new Account(client);\\n\\n// Register User\\naccount.create(\\n ID.unique(),\\n 'me@example.com',\\n 'password',\\n 'Jane Doe'\\n).then(response => {\\n console.log(response);\\n}, error => {\\n console.log(error);\\n});\"]}, {\"level\": 2, \"title\": \"Listen to Changes\", \"body\": [\"To listen to changes in realtime from Appwrite, subscribe to a variety of channels and receive updates within milliseconds. Full documentation for Realtime is found here.\", \" // Subscribe to files channel\\nclient.subscribe('files', response => {\\n if(response.events.includes('buckets.*.files.*.create')) {\\n // Log when a new file is uploaded\\n console.log(response.payload);\\n }\\n});\"]}, {\"level\": 2, \"title\": \"Full Example\", \"body\": [\" import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\n// Register User\\naccount.create(\\n ID.unique(),\\n 'me@example.com',\\n 'password',\\n 'Jane Doe'\\n).then(response => {\\n console.log(response);\\n}, error => {\\n console.log(error);\\n});\\n\\n// Subscribe to files channel\\nclient.subscribe('files', response => {\\n if(response.events.includes('buckets.*.files.*.create')) {\\n // Log when a new file is uploaded\\n console.log(response.payload);\\n }\\n});\"]}, {\"level\": 2, \"title\": \"Demos\", \"body\": [\"Below is a list of some demos to help you get started with Appwrite for Web using your favorite tools and framework of choice.\", \" Demo GitHub Repository Todo App with React JS appwrite/todo-with-react Live Example Todo App with Vue JS appwrite/todo-with-vue Live Example Todo App with Angular appwrite/todo-with-angular Live Example Todo App with Svelte appwrite/todo-with-svelte Live Example \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/getting-started-for-web"}} \ No newline at end of file diff --git a/docs/ee438b68-1f0c-11ee-98fa-00155da08df7.json b/docs/4eeba62a-4583-11ee-9922-f2ea36f81204.json similarity index 97% rename from docs/ee438b68-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eeba62a-4583-11ee-9922-f2ea36f81204.json index 3909b7e..49da4dc 100644 --- a/docs/ee438b68-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eeba62a-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Getting Started for Flutter \", \"body\": [\"Appwrite is a development platform that provides a powerful API and management console to get your next project up and running quickly.\", \"Create your first project now and start building on Appwrite Cloud.\"]}, {\"level\": 2, \"title\": \"Add your Flutter Platform\", \"body\": [\"To init your SDK and start interacting with Appwrite services, you need to add a new Flutter platform to your project. To add a new platform, go to your Appwrite console, choose the project you created in the step before, and click the 'Add Platform' button. Only API requests initiated from platforms added to your Appwrite project will be accepted. This prevents unauthorized apps from accessing your Appwrite project.\", \"From the options, choose to add a new Flutter platform and add your app credentials. Appwrite Flutter SDK currently supports building apps for Android, iOS, Linux, Mac OS, Web and Windows.\", \"If you are building your Flutter application for multiple devices, you have to follow this process for each different device.\"]}, {\"level\": 3, \"title\": \"Android\", \"body\": [\"For Android first add your app name and package name, Your package name is generally the applicationId in your app-level build.gradle file. By registering your new app platform, you are allowing your app to communicate with the Appwrite API.\", \"In order to capture the Appwrite OAuth callback url, the following activity needs to be added inside the `` tag, along side the existing `` tags in your AndroidManifest.xml. Be sure to replace the [PROJECT_ID] string with your actual Appwrite project ID. You can find your Appwrite project ID in you project settings screen in your Appwrite console.\", \" \\n ...\\n \\n ...\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\"]}, {\"level\": 3, \"title\": \"iOS\", \"body\": [\"For iOS first add your app name and Bundle ID, You can find your Bundle Identifier in the General tab for your app's primary target in Xcode.\", \"The Appwrite SDK uses ASWebAuthenticationSession on iOS 12+ and SFAuthenticationSession on iOS 11 to allow OAuth authentication. You have to change your iOS Deployment Target in Xcode to be iOS >= 11 to be able to build your app on an emulator or a real device.\", \" In Xcode, open Runner.xcworkspace in your app's iOS folder. To view your app's settings, select the Runner project in the Xcode project navigator. Then, in the main view sidebar, select the Runner target. Select the General tab. In Deployment Info, 'Target' select iOS 11.0\"]}, {\"level\": 3, \"title\": \"Linux\", \"body\": [\"For Linux add your app name and package name, Your package name is generally the name in your pubspec.yaml file. If you cannot find the correct package name, run the application in linux, and make any request with proper exception handling, you should get the application id needed to add in the received error message.\"]}, {\"level\": 3, \"title\": \"macOS\", \"body\": [\"For macOS add your app name and Bundle ID, You can find your Bundle Identifier in the General tab for your app's primary target in Xcode.\", \"The Appwrite SDK uses ASWebAuthenticationSession on macOS 10.15+ to allow OAuth authentication. You have to change your macOS Deployment Target in Xcode to be macOS >= 10.15 to be able to build your app for macOS.\"]}, {\"level\": 3, \"title\": \"Web\", \"body\": [\"To build web apps that integrate with Appwrite successfully, you must add a web platform on your Appwrite project's dashboard and list the domain your website uses to allow communication to the Appwrite API. The process is similar to the adding a web platform in the web guide.\", \"For web in order to capture the OAuth2 callback URL and send it to the application using JavaScript postMessage(), you need to create an html file inside ./web folder of your Flutter project. For example auth.html with the following content.\", \" \\nAuthentication complete\\n

Authentication is complete. If this does not happen automatically, please\\nclose the window.\\n\", \"The redirection URL passed to the authentication service must be the same as the URL on which the application is running (schema, host, port if necessary), and the path must point to created HTML file, /auth.html in this case. The callbackUrlScheme parameter of the authenticate() method does not take into account, so it is possible to use a schema for native platforms in the code.\", \" Flutter Web Cross-Domain Communication & Cookies While running Flutter Web, make sure your Appwrite server and your Flutter client use the same top-level domain and protocol (HTTP or HTTPS) to communicate. When communicating between different domains or protocols, you may receive HTTP status error 401 because some modern browsers block cross-site or insecure cookies for enhanced privacy. In production, Appwrite allows you set multiple custom-domains for each project.\"]}, {\"level\": 3, \"title\": \"Windows\", \"body\": [\"For Windows add your app name and package name, Your package name is generally the name in your pubspec.yaml file. If you cannot find the correct package name, run the application in windows, and make any request with proper exception handling, you should get the application id needed to add in the received error message.\"]}, {\"level\": 2, \"title\": \"Get Appwrite Flutter SDK\", \"body\": [\"Add Appwrite SDK to your package's pubspec.yaml file (view example):\", \" dependencies:\\n appwrite: ^9.0.0\", \"You can also install the SDK using the Dart package manager from your terminal:\", \" flutter pub add appwrite\"]}, {\"level\": 2, \"title\": \"Init your SDK\", \"body\": [\"Initialize your SDK with your endpoint and project ID, which can be found on your project settings page. It's usually a good practice to initialize the Client and make it available across the app using the state management solution of your choice, as the Client is required for making any calls to the Appwrite API.\", \" import 'package:appwrite/appwrite.dart';\\n\\nClient client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\", \"Before sending any API calls to your new Appwrite project, make sure your mobile device or emulator has network access to your Appwrite project's hostname or IP address.\"]}, {\"level\": 2, \"title\": \"Make Your First Request\", \"body\": [\"After your SDK configuration is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section.\", \" // Register User\\nAccount account = Account(client);\\n\\nfinal user = await account.create(\\n userId: ID.unique(),\\n email: 'me@appwrite.io',\\n password: 'password',\\n name: 'My Name'\\n);\\n\"]}, {\"level\": 2, \"title\": \"Listen to Changes\", \"body\": [\"If you want to listen to changes in realtime from Appwrite, you can subscribe to a variety of channels and receive updates within milliseconds. Full documentation for Realtime can be found here.\", \" // Subscribe to files channel\\nfinal realtime = Realtime(client);\\nfinal subscription = realtime.subscribe(['files']);\\n\\nsubscription.stream.listen((response) {\\n if (response.events.contains('buckets.*.files.*.create') {\\n // Log when a new file is uploaded\\n print(response.payload);\\n }\\n});\\n\"]}, {\"level\": 2, \"title\": \"Full Example\", \"body\": [\" import 'package:appwrite/appwrite.dart';\\n\\nClient client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nAccount account = Account(client);\\n\\nfinal user = await account.create(\\n userId: ID.unique(),\\n email: 'me@appwrite.io',\\n password: 'password',\\n name: 'My Name'\\n);\\n\\n// Subscribe to files channel\\nfinal realtime = Realtime(client);\\nfinal subscription = realtime.subscribe(['files']);\\n\\nsubscription.stream.listen((response) {\\n if (response.events.contains('buckets.*.files.*.create')) {\\n // Log when a new file is uploaded\\n print(response.payload);\\n }\\n});\\n\"]}]", "metadata": {"source": "https://appwrite.io/docs/getting-started-for-flutter"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Getting Started for Flutter \", \"body\": [\"Appwrite is a development platform that provides a powerful API and management console to get your next project up and running quickly.\", \"Create your first project now and start building on Appwrite Cloud.\"]}, {\"level\": 2, \"title\": \"Add your Flutter Platform\", \"body\": [\"To init your SDK and start interacting with Appwrite services, you need to add a new Flutter platform to your project. To add a new platform, go to your Appwrite Console, choose the project you created in the step before, and click the 'Add Platform' button. Only API requests initiated from platforms added to your Appwrite project will be accepted. This prevents unauthorized apps from accessing your Appwrite project.\", \"From the options, choose to add a new Flutter platform and add your app credentials. Appwrite Flutter SDK currently supports building apps for Android, iOS, Linux, Mac OS, Web and Windows.\", \"If you are building your Flutter application for multiple devices, you have to follow this process for each different device.\"]}, {\"level\": 3, \"title\": \"Android\", \"body\": [\"For Android first add your app name and package name, Your package name is generally the applicationId in your app-level build.gradle file. By registering your new app platform, you are allowing your app to communicate with the Appwrite API.\", \"In order to capture the Appwrite OAuth callback url, the following activity needs to be added inside the `` tag, along side the existing `` tags in your AndroidManifest.xml. Be sure to replace the [PROJECT_ID] string with your actual Appwrite project ID. You can find your Appwrite project ID in you project settings screen in your Appwrite Console.\", \" \\n ...\\n \\n ...\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\"]}, {\"level\": 3, \"title\": \"iOS\", \"body\": [\"For iOS first add your app name and Bundle ID, You can find your Bundle Identifier in the General tab for your app's primary target in Xcode.\", \"The Appwrite SDK uses ASWebAuthenticationSession on iOS 12+ and SFAuthenticationSession on iOS 11 to allow OAuth authentication. You have to change your iOS Deployment Target in Xcode to be iOS >= 11 to be able to build your app on an emulator or a real device.\", \" In Xcode, open Runner.xcworkspace in your app's iOS folder. To view your app's settings, select the Runner project in the Xcode project navigator. Then, in the main view sidebar, select the Runner target. Select the General tab. In Deployment Info, 'Target' select iOS 11.0\"]}, {\"level\": 3, \"title\": \"Linux\", \"body\": [\"For Linux add your app name and package name, Your package name is generally the name in your pubspec.yaml file. If you cannot find the correct package name, run the application in linux, and make any request with proper exception handling, you should get the application id needed to add in the received error message.\"]}, {\"level\": 3, \"title\": \"macOS\", \"body\": [\"For macOS add your app name and Bundle ID, You can find your Bundle Identifier in the General tab for your app's primary target in Xcode.\", \"The Appwrite SDK uses ASWebAuthenticationSession on macOS 10.15+ to allow OAuth authentication. You have to change your macOS Deployment Target in Xcode to be macOS >= 10.15 to be able to build your app for macOS.\"]}, {\"level\": 3, \"title\": \"Web\", \"body\": [\"To build web apps that integrate with Appwrite successfully, you must add a web platform on your Appwrite project's dashboard and list the domain your website uses to allow communication to the Appwrite API. The process is similar to the adding a web platform in the web guide.\", \"For web in order to capture the OAuth2 callback URL and send it to the application using JavaScript postMessage(), you need to create an html file inside ./web folder of your Flutter project. For example auth.html with the following content.\", \" \\nAuthentication complete\\n

Authentication is complete. If this does not happen automatically, please\\nclose the window.\\n\", \"The redirection URL passed to the authentication service must be the same as the URL on which the application is running (schema, host, port if necessary), and the path must point to created HTML file, /auth.html in this case. The callbackUrlScheme parameter of the authenticate() method does not take into account, so it is possible to use a schema for native platforms in the code.\", \" Flutter Web Cross-Domain Communication & Cookies While running Flutter Web, make sure your Appwrite server and your Flutter client use the same top-level domain and protocol (HTTP or HTTPS) to communicate. When communicating between different domains or protocols, you may receive HTTP status error 401 because some modern browsers block cross-site or insecure cookies for enhanced privacy. In production, Appwrite allows you set multiple custom-domains for each project.\"]}, {\"level\": 3, \"title\": \"Windows\", \"body\": [\"For Windows add your app name and package name, Your package name is generally the name in your pubspec.yaml file. If you cannot find the correct package name, run the application in windows, and make any request with proper exception handling, you should get the application id needed to add in the received error message.\"]}, {\"level\": 2, \"title\": \"Get Appwrite Flutter SDK\", \"body\": [\"Add Appwrite SDK to your package's pubspec.yaml file (view example):\", \" dependencies:\\n appwrite: ^9.0.0\", \"You can also install the SDK using the Dart package manager from your terminal:\", \" flutter pub add appwrite\"]}, {\"level\": 2, \"title\": \"Init your SDK\", \"body\": [\"Initialize your SDK with your endpoint and project ID, which can be found on your project settings page. It's usually a good practice to initialize the Client and make it available across the app using the state management solution of your choice, as the Client is required for making any calls to the Appwrite API.\", \" import 'package:appwrite/appwrite.dart';\\n\\nClient client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\", \"Before sending any API calls to your new Appwrite project, make sure your mobile device or emulator has network access to your Appwrite project's hostname or IP address.\"]}, {\"level\": 2, \"title\": \"Make Your First Request\", \"body\": [\"After your SDK configuration is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section.\", \" // Register User\\nAccount account = Account(client);\\n\\nfinal user = await account.create(\\n userId: ID.unique(),\\n email: 'me@appwrite.io',\\n password: 'password',\\n name: 'My Name'\\n);\\n\"]}, {\"level\": 2, \"title\": \"Listen to Changes\", \"body\": [\"If you want to listen to changes in realtime from Appwrite, you can subscribe to a variety of channels and receive updates within milliseconds. Full documentation for Realtime can be found here.\", \" // Subscribe to files channel\\nfinal realtime = Realtime(client);\\nfinal subscription = realtime.subscribe(['files']);\\n\\nsubscription.stream.listen((response) {\\n if (response.events.contains('buckets.*.files.*.create') {\\n // Log when a new file is uploaded\\n print(response.payload);\\n }\\n});\\n\"]}, {\"level\": 2, \"title\": \"Full Example\", \"body\": [\" import 'package:appwrite/appwrite.dart';\\n\\nClient client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nAccount account = Account(client);\\n\\nfinal user = await account.create(\\n userId: ID.unique(),\\n email: 'me@appwrite.io',\\n password: 'password',\\n name: 'My Name'\\n);\\n\\n// Subscribe to files channel\\nfinal realtime = Realtime(client);\\nfinal subscription = realtime.subscribe(['files']);\\n\\nsubscription.stream.listen((response) {\\n if (response.events.contains('buckets.*.files.*.create')) {\\n // Log when a new file is uploaded\\n print(response.payload);\\n }\\n});\\n\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/getting-started-for-flutter"}} \ No newline at end of file diff --git a/docs/4eebb958-4583-11ee-9922-f2ea36f81204.json b/docs/4eebb958-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..6da10c8 --- /dev/null +++ b/docs/4eebb958-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Getting Started for Apple \", \"body\": [\"Appwrite is a development platform that provides a powerful API and management console to get your next project up and running quickly.\", \"Create your first project now and start building on Appwrite Cloud.\"]}, {\"level\": 2, \"title\": \"Add your Apple Platform\", \"body\": [\"To init your SDK and start interacting with Appwrite services, you need to add a new Apple platform to your project. To add a new platform, go to your Appwrite Console, choose the project you created in the step before, and click the 'Add Platform' button. Only API requests initiated from platforms added to your Appwrite project will be accepted. This prevents unauthorized apps from accessing your Appwrite project.\", \"From the options, choose to add a new Apple platform, select the iOS, macOS, watchOS or tvOS tab and add your app name and bundle identifier, Your bundle identifier can be found at the top of the General tab in your project settings, or in your Info.plist file. By registering your new app platform, you are allowing your app to communicate with the Appwrite API.\"]}, {\"level\": 2, \"title\": \"Get Appwrite Apple SDK\", \"body\": []}, {\"level\": 3, \"title\": \"Using Xcode\", \"body\": [\" Select File > Add Packages Search for the Appwrite SDK with the URL https://github.com/appwrite/sdk-for-apple In the right panel, select your target project and add your desired version rules Select Add Package and wait for package resolution to complete Make sure the Appwrite package product is checked and select Add Package again\"]}, {\"level\": 3, \"title\": \"Using Swift Packages\", \"body\": [\"Add the following to your Package.swift file: \", \" dependencies: [\\n .package(\\n name: \\\"Appwrite\\\",\\n url: \\\"https://github.com/appwrite/sdk-for-apple\\\",\\n .exact(\\\"2.0.0\\\")\\n )\\n]')\", \"Then add the dependency to your target:\", \" targets: [\\n .target(\\n name: \\\"[YOUR_TARGET]\\\",\\n dependencies: [\\n \\\"Appwrite\\\"\\n ]\\n )\\n]\"]}, {\"level\": 3, \"title\": \"OAuth Callback\", \"body\": [\"In order to capture the Appwrite OAuth callback url, the following URL scheme needs to added to your Info.plist.\", \" CFBundleURLTypes\\n\\n\\n CFBundleTypeRole\\n Editor\\n CFBundleURLName\\n io.appwrite\\n CFBundleURLSchemes\\n \\n appwrite-callback-[PROJECT_ID]\\n \\n\\n\\n\", \"If you're using UIKit, you'll also need to add a hook to your SceneDelegate.swift file to ensure cookies work correctly.\", \" \\nfunc scene(_ scene: UIScene, openURLContexts URLContexts: Set) {\\n guard let url = URLContexts.first?.url,\\n url.absoluteString.contains(\\\"appwrite-callback\\\") else {\\n return\\n }\\n WebAuthComponent.handleIncomingCookie(from: url)\\n}\\n\"]}, {\"level\": 2, \"title\": \"Init your SDK\", \"body\": [\"Initialize your SDK code with your project ID, which can be found in your project settings page.\", \" import Appwrite\\nimport AppwriteModels\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\", \"Before sending any API calls to your new Appwrite project, make sure your device or emulator has network access to your Appwrite project's hostname or IP address.\"]}, {\"level\": 2, \"title\": \"Make Your First Request\", \"body\": [\"After your SDK configuration is set, access any of the Appwrite services and choose any request to send. Complete documentation for any service method you would like to use can be found in your SDK documentation or in the API References section.\", \" // Register User\\nlet account = Account(client)\\n\\nlet user = try await account.create(\\n userId: ID.unique(),\\n email: \\\"email@example.com\\\",\\n password: \\\"password\\\"\\n)\"]}, {\"level\": 2, \"title\": \"Listen to Changes\", \"body\": [\"To listen to changes in realtime from Appwrite, subscribe to a variety of channels and receive updates within milliseconds. Full documentation for Realtime can be found here.\", \" // Subscribe to files channel\\nlet realtime = Realtime(client)\\n\\nlet subscription = realtime.subscribe(channels: [\\\"files\\\"]) { message in\\n if (message.events!.contains(\\\"buckets.*.files.*.create\\\")) {\\n // Log when a new file is uploaded\\n print(String(describing: message.payload))\\n }\\n}\", \"If you're using macOS, for realtime to function correctly you need to ensure you have both \\\"Outgoing Connections (Client)\\\" and \\\"Incoming Connections (Server)\\\" enabled in your App Sandbox settings in your project file.\"]}, {\"level\": 2, \"title\": \"Full Example\", \"body\": [\" import Appwrite\\nimport AppwriteModels\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\n// Register User\\nlet account = Account(client)\\n\\nlet user = try await account.create(\\n userId: ID.unique(),\\n email: \\\"email@example.com\\\",\\n password: \\\"password\\\"\\n)\\n\\n// Subscribe to files channel\\nlet realtime = Realtime(client)\\n\\nlet subscription = realtime.subscribe(channels: [\\\"files\\\"]) { message in\\n if (message.events!.contains(\\\"buckets.*.files.*.create\\\")) {\\n // Log when a new file is uploaded\\n print(String(describing: message.payload))\\n }\\n}\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/getting-started-for-apple"}} \ No newline at end of file diff --git a/docs/4eebc240-4583-11ee-9922-f2ea36f81204.json b/docs/4eebc240-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..48b201b --- /dev/null +++ b/docs/4eebc240-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Getting Started for Android \", \"body\": [\"Appwrite is a development platform that provides a powerful API and management console to get your next project up and running quickly.\", \"Create your first project now and start building on Appwrite Cloud.\"]}, {\"level\": 2, \"title\": \"Add your Android Platform\", \"body\": [\"To init your SDK and start interacting with Appwrite services, you need to add a new Android platform to your project. To add a new platform, go to your Appwrite Console, choose the project you created in the step before, and click the 'Add Platform' button. Only API requests initiated from platforms added to your Appwrite project will be accepted. This prevents unauthorized apps from accessing your Appwrite project.\", \"From the options, choose to add a new Android platform and add add your app name and package name, your package name is generally the applicationId in your app-level build.gradle file. By registering your new app platform, you are allowing your app to communicate with the Appwrite API.\"]}, {\"level\": 2, \"title\": \"Get Appwrite Android SDK\", \"body\": [\"First, add this to your root level build.gradle file: \", \" repositories {\\n mavenCentral()\\n}\", \"Then add this to your project's build.gradle file:\", \" implementation(\\\"io.appwrite:sdk-for-android:2.0.0\\\")\"]}, {\"level\": 3, \"title\": \"OAuth Callback\", \"body\": [\"In order to capture the Appwrite OAuth callback url, the following activity needs to be added inside the tag, along side the existing tags in your AndroidManifest.xml. Be sure to replace the [PROJECT_ID] string with your actual Appwrite project ID. You can find your Appwrite project ID in your project settings screen in your Appwrite Console.\", \" \\n ...\\n \\n ...\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\"]}, {\"level\": 2, \"title\": \"Init your SDK\", \"body\": [\"Initialize your SDK code with your project ID, which can be found in your project settings page.\", \" import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\", \"Before sending any API calls to your new Appwrite project, make sure your Android device or emulator has network access to your Appwrite project's hostname or IP address.\"]}, {\"level\": 2, \"title\": \"Make Your First Request\", \"body\": [\"After your SDK configuration is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would like to use can be found in the SDK documentation or in the API References section.\", \" // Register User\\nval account = Account(client)\\n\\nval user = account.create(\\n userId = ID.unique(),\\n email = \\\"email@example.com\\\",\\n password = \\\"password\\\"\\n)\"]}, {\"level\": 2, \"title\": \"Listen to Changes\", \"body\": [\"To listen to changes in realtime from Appwrite, subscribe to a variety of channels and receive updates within milliseconds. Full documentation for Realtime can be found here.\", \" // Subscribe to files channel\\nval realtime = Realtime(client)\\n\\nval subscription = realtime.subscribe(\\\"files\\\") {\\n if (it.events.contains(\\\"buckets.*.files.*.create\\\")) {\\n // Log when a new file is uploaded\\n print(it.payload.toString());\\n }\\n})\\n\"]}, {\"level\": 2, \"title\": \"Full Example\", \"body\": [\" import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.create(\\n userId = ID.unique(),\\n email = \\\"email@example.com\\\",\\n password = \\\"password\\\"\\n)\\n\\n// Subscribe to files channel\\nval realtime = Realtime(client)\\n\\nval subscription = realtime.subscribe(\\\"files\\\") {\\n if (it.events.contains(\\\"buckets.*.files.*.create\\\")) {\\n // Log when a new file is uploaded\\n print(it.payload.toString());\\n }\\n}\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/getting-started-for-android"}} \ No newline at end of file diff --git a/docs/4eebcb14-4583-11ee-9922-f2ea36f81204.json b/docs/4eebcb14-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..36d5798 --- /dev/null +++ b/docs/4eebcb14-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Getting Started for Server \", \"body\": [\"Appwrite is a development platform that provides a powerful API and management console to get your next project up and running quickly.\", \"Create your first project now and start building on Appwrite Cloud.\"]}, {\"level\": 2, \"title\": \"Get the Appwrite SDK for Your Platform\", \"body\": [\"We provide libraries and SDKs for major programming languages and platforms so you don't have to write code for interacting with our HTTP APIs from scratch.\", \"Choose your desired SDK corresponding to your product development platform and import it using the given package manager. For the sake of this tutorial we use code examples using Appwrite SDKs for Node.js, PHP, Python, Ruby, Dart, and Deno, but the same can be applied to any of our server side SDKs.\", \" Node.js npm install node-appwrite --save PHP composer require 'appwrite/appwrite' Python pip install appwrite Ruby gem install appwrite Deno import * as sdk from \\\"https://deno.land/x/appwrite/mod.ts\\\"; Dart dart pub add dart_appwrite Kotlin Add maven repositories to your build.gradle(.kts) file repositories {\\n mavenCentral()\\n} Add Appwrite SDK under dependencies in your build.gradle(.kts) file dependencies {\\n implementation(\\\"io.appwrite:sdk-for-kotlin:2.0.0\\\")\\n} Swift Add the Appwrite Swift SDK package as a dependency dependencies: [\\n .package(\\n name: \\\"Appwrite\\\",\\n url: \\\"https://github.com/appwrite/sdk-for-swift.git\\\",\\n .exact(\\\"2.0.0\\\")\\n )\\n] Add the dependency product to your target dependencies: [\\n \\\"Appwrite\\\"\\n] .NET dotnet add package Appwrite \"]}, {\"level\": 2, \"title\": \"Create Your First Appwrite Project\", \"body\": [\"Go to your new Appwrite Console and click the icon in the top navigation header or on the 'Create Project' button on your console homepage. Choose a name for your project and click create to get started.\"]}, {\"level\": 2, \"title\": \"Authentication\", \"body\": [\"The Appwrite server API provides you with two authentication methods. The first one uses an API key, and the second is using a JSON Web Token (JWT). Each method has different use cases, and you can use whichever fills your app needs.\"]}, {\"level\": 3, \"title\": \"API Key\", \"body\": [\"Using an API Key you can interact with the Appwrite server API as an admin. You'll be able to access all of your project resources as long as your key has the relevant access scopes attached. To get your first API key, go to your appwrite console, choose the project you created in the step before and click the 'API Keys' link.\", \"Inside your API keys screen, click the 'Add API Key' button, choose your key name, for example: 'Demo Key', and select the scopes your key are granted to use. After complete, you could copy your new API Key and use it to initialize your Appwrite server SDK. To learn about the different API scopes available to you, read more about Appwrite API Keys \", \" Node.js const { Client } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n PHP use Appwrite\\\\Client;\\n\\n$client = (new Client())\\n ->setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n ->setProject('[PROJECT_ID]') // Your project ID\\n ->setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n Python from appwrite.client import Client\\n\\nclient = Client()\\n\\nclient = (client\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_key('919c2db5d4...a2a3346ad2') # Your secret API key\\n)\\n Ruby require 'appwrite'\\n\\nclient = Appwrite::Client.new()\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_key('919c2db5d4...a2a3346ad2') # Your secret API key\\n Deno import { Client } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n Dart import 'package:dart_appwrite/dart_appwrite.dart';\\n\\nClient client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n Kotlin import io.appwrite.Client\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setKey(\\\"919c2db5d4...a2a3346ad2\\\") // Your secret API key\\n Swift import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setKey(\\\"919c2db5d4...a2a3346ad2\\\") // Your secret API key\\n .NET using Appwrite;\\n\\nvar client = new Client()\\n .SetEndpoint(\\\"http://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .SetProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .SetKey(\\\"919c2db5d4...a2a3346ad2\\\"); // Your secret API Key \", \" API Key Authentication When using Server SDKs, you authenticate with API keys. API keys are not restricted by account-based permissions but have restrictions on the types of resources that can be accessed. This means API keys can access all resources of specified types, regardless of which account can access them. Learn more about API keys\"]}, {\"level\": 3, \"title\": \"JSON Web Token (JWT) \\u00a0version >= 0.8\", \"body\": [\"Using a JSON Web Token (JWT), you can interact with the Appwrite server API as a specific user. You'll be able to access only the relevant user resources and perform actions on his behalf.\", \"To create a JWT, you need to use the \\\"account->createJWT\\\" method using one of the Appwrite client SDKs. Before creating a token, you need to make sure your user is authenticated using the createSession method or log in with an OAuth provider.\", \" Web SDK const account = new Account(client);\\naccount.createJWT()\\n .then(function (response) {\\n console.log(response);\\n }, function (error) {\\n console.log(error);\\n }); Flutter SDK Account account = Account(client);\\n\\nResponse user = await account.createJWT();\\n Android SDK val account = Account(client)\\n\\nval response = account.createJWT()\\n Apple SDK let account = Account(client)\\n\\nlet response = try await account.createJWT() \", \"After you get your valid token, you can pass it to your server and use it to initialize your Appwrite Server SDK and start making API calls. Your JWT is valid for a maximum time of 15 minutes or less if the user session has expired before that time.\", \" Node.js const { Client } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setJWT('919c2db5d4...a2a3346ad2'); // Your secret JWT\\n PHP use Appwrite\\\\Client;\\n\\n$client = (new Client())\\n ->setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n ->setProject('[PROJECT_ID]') // Your project ID\\n ->setJWT('919c2db5d4...a2a3346ad2'); // Your secret JWT\\n Python from appwrite.client import Client\\n\\nclient = Client()\\n\\nclient = (client\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_key('919c2db5d4...a2a3346ad2') # Your secret API key\\n)\\n Ruby require 'appwrite'\\n\\nclient = Client.new()\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_key('919c2db5d4...a2a3346ad2') # Your secret JWT\\n Deno import { Client } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setJWT('919c2db5d4...a2a3346ad2'); // Your secret JWT\\n Dart import 'package:dart_appwrite/dart_appwrite.dart';\\n\\nClient client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setJWT('919c2db5d4...a2a3346ad2'); // Your secret JWT\\n Kotlin import io.appwrite.Client\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setJWT(\\\"919c2db5d4...a2a3346ad2\\\") // Your secret JWT\\n Swift import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setJWT(\\\"919c2db5d4...a2a3346ad2\\\") // Your secret JWT\\n .NET using Appwrite;\\n\\nvar client = new Client()\\n .SetEndpoint(\\\"http://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .SetProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .SetJWT(\\\"919c2db5d4...a2a3346ad2\\\"); // Your secret JWT\\n \"]}, {\"level\": 2, \"title\": \"Make Your First Request\", \"body\": [\"After your SDK configuration is set, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section.\", \" Node.js const { ID, Users } = require('node-appwrite');\\n\\nconst users = new Users(client);\\n\\nlet promise = users.create(\\n ID.unique(),\\n 'email@example.com',\\n null,\\n 'password'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); PHP use Appwrite\\\\ID;\\nuse Appwrite\\\\Services\\\\Users;\\n \\n$users = new Users($client);\\n\\n$user = $users->create(\\n userId: ID::unique(),\\n email: 'email@example.com',\\n phone: null,\\n password: 'password'\\n);\\n Python from appwrite.id import ID\\nfrom appwrite.services.users import Users\\n\\nusers = Users(client)\\n\\nuser = users.create(\\n user_id=ID.unique(),\\n email='email@example.com',\\n phone=None,\\n password='password'\\n) Ruby require 'appwrite'\\n\\nusers = Appwrite::Users.new(client)\\n\\nuser = users.create(\\n userId: ID.unique(),\\n email: 'email@example.com',\\n phone: nil,\\n password: 'password'\\n) Deno import { ID, Users } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n \\nconst users = new Users(client);\\n\\nlet promise = users.create(\\n ID.unique(),\\n 'email@example.com',\\n null,\\n 'password'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Dart import 'package:dart_appwrite/dart_appwrite.dart';\\n\\nfinal users = Users(client);\\n\\nfinal user = await users.create(\\n userId: ID.unique(),\\n email: 'email@example.com',\\n phone: null,\\n password: 'password'\\n); Kotlin import io.appwrite.ID\\nimport io.appwrite.services.Users\\n\\nval users = Users(client)\\n\\nval user = users.create(\\n userId = ID.unique(),\\n email = 'email@example.com',\\n phone = null,\\n password = 'password'\\n) Swift import Appwrite\\nimport AppwriteModels\\n \\nlet users = Users(client)\\n\\nlet user = try await users.create(\\n userId: ID.unique(),\\n email: \\\"email@example.com\\\",\\n phone: nil,\\n password: \\\"password\\\"\\n) .NET using Appwrite.Services;\\nusing Appwrite.Models;\\n\\nvar users = new Users(client);\\n\\nvar user = await users.Create(\\n userId: ID.Unique(),\\n email: \\\"email@example.com\\\",\\n phone: null,\\n password: \\\"password\\\"); \"]}, {\"level\": 2, \"title\": \"Full Example\", \"body\": [\" Node.js const { Client, ID, Users } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n\\nconst users = new Users(client);\\n\\nlet promise = users.create(\\n ID.unique(),\\n 'email@example.com',\\n null,\\n 'password'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); PHP use Appwrite\\\\Client;\\nuse Appwrite\\\\ID;\\nuse Appwrite\\\\Services\\\\Users;\\n\\n$client = (new Client())\\n ->setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n ->setProject('[PROJECT_ID]') // Your project ID\\n ->setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n\\n$users = new Users($client);\\n\\n$user = $users->create(\\n userId: ID::unique(),\\n email: 'email@example.com',\\n phone: null,\\n password: 'password'\\n); Python from appwrite.client import Client\\nfrom appwrite.id import ID\\nfrom appwrite.services.users import Users\\n\\nclient = Client()\\n\\nclient = (client\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_key('919c2db5d4...a2a3346ad2') # Your secret API key\\n)\\n\\nusers = Users(client)\\n\\nuser = users.create(\\n user_id=ID.unique(),\\n email='email@example.com',\\n phone=None,\\n password='password'\\n) Ruby require 'appwrite'\\n\\ninclude Appwrite\\n\\nclient = Client.new()\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_key('919c2db5d4...a2a3346ad2') # Your secret API key\\n\\nusers = Users.new(client)\\n\\nuser = users.create(\\n userId: ID.unique(),\\n email: 'email@example.com',\\n phone: nil,\\n password: 'password'\\n) Deno import { Client, ID, Users } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setKey('919c2db5d4...a2a3346ad2') // Your secret API key\\n\\nconst users = new Users(client);\\n\\nlet promise = users.create(\\n ID.unique(),\\n 'email@example.com',\\n null,\\n 'password'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Dart import 'package:dart_appwrite/dart_appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n\\nfinal users = Users(client);\\n\\nfinal user = await users.create(\\n userId: ID.unique(),\\n email: 'email@example.com',\\n phone: null,\\n password: 'password'\\n); Kotlin import io.appwrite.Client\\nimport io.appwrite.ID\\nimport io.appwrite.services.Users\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setKey(\\\"919c2db5d4...a2a3346ad2\\\") // Your secret API key\\n\\nval users = Users(client)\\n\\nval user = users.create(\\n userId = ID.unique(),\\n email = 'email@example.com',\\n phone = null,\\n password = 'password'\\n) Swift import Appwrite\\nimport AppwriteModels\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setKey(\\\"919c2db5d4...a2a3346ad2\\\") // Your secret API key\\n\\nlet users = Users(client)\\n\\nlet user = try await users.create(\\n userId: ID.unique(),\\n email: \\\"email@example.com\\\",\\n phone: nil,\\n password: \\\"password\\\"\\n) .NET using Appwrite;\\nusing Appwrite.Services;\\nusing Appwrite.Models;\\n\\nvar client = new Client()\\n .SetEndpoint(\\\"http://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .SetProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .SetKey(\\\"cd868db89\\\"); // Your secret API key\\n\\nvar users = new Users(client);\\n\\nvar user = await users.Create(\\n userId: ID.Unique(),\\n email: \\\"email@example.com\\\",\\n phone: null,\\n password: \\\"password\\\"); \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/getting-started-for-server"}} \ No newline at end of file diff --git a/docs/ee439838-1f0c-11ee-98fa-00155da08df7.json b/docs/4eebdd98-4583-11ee-9922-f2ea36f81204.json similarity index 98% rename from docs/ee439838-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eebdd98-4583-11ee-9922-f2ea36f81204.json index 4130a17..1cb2580 100644 --- a/docs/ee439838-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eebdd98-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Appwrite CLI \", \"body\": [\"The Appwrite CLI is a command-line application that allows you to interact with the Appwrite server and perform server-side tasks using your terminal. This includes creating and managing projects, managing resources (documents, files, users), creating and deploying Appwrite Functions, and other operations available through Appwrite's API.\"]}, {\"level\": 2, \"title\": \"Installation\", \"body\": [\"The CLI is packaged both as an npm module as well as a standalone binary for your operating system, making it completely dependency free, platform independent and language agnostic.\", \"If you plan to use the CLI to initialize new Appwrite Functions, ensure that Git is installed on your machine.\"]}, {\"level\": 3, \"title\": \"Install with NPM\", \"body\": [\"If you have npm set up, run the command below to install the CLI\", \" npm install -g appwrite-cli\"]}, {\"level\": 3, \"title\": \"Install with Script\", \"body\": [\"For a completely dependency-free installation, the CLI also ships with a convenient installation script for your operating system\", \" MacOS Using Homebrew brew tap appwrite/sdk-for-cli https://github.com/appwrite/sdk-for-cli\\nbrew update\\nbrew install --HEAD appwrite or terminal curl -sL https://appwrite.io/cli/install.sh | bash Windows iwr -useb https://appwrite.io/cli/install.ps1 | iex Linux curl -sL https://appwrite.io/cli/install.sh | bash \", \"After the installation is complete, verify the install using\", \" appwrite -v\"]}, {\"level\": 2, \"title\": \"Getting Started\", \"body\": [\"Before you can use the CLI, you need to login to your Appwrite account using\", \" appwrite login\", \" Self-Signed Certificates By default, requests to domains with self-signed SSL certificates (or no certificates) are disabled. If you trust the domain, you can bypass the certificate validation using appwrite client --selfSigned true \", \"You can run your first CLI command after logging in. Try fetching information about your Appwrite project.\", \" appwrite projects get --projectId [PROJECT_ID]\"]}, {\"level\": 2, \"title\": \"Next Steps\", \"body\": [\"You can use the CLI to create and deploy functions and collections. Deploy commands allow you to configure your Appwrite project programmatically and replicate functions and collection schemas across Appwrite projects.\", \"Learn more about deployment\", \"Besides utility commands, the CLI can be used to execute commands like a Server SDK.\", \"Find a full list of commands\", \"You can choose to use the CLI in a headless and non-interactive mode without the need for config files or sessions. This is useful for CI or scripting use cases.\", \"Learn more about CI mode\"]}, {\"level\": 2, \"title\": \"Help\", \"body\": [\"If you get stuck anywhere, you can always use the help command to get the usage examples.\"]}, {\"level\": 2, \"title\": \"Configuration\", \"body\": [\"At any point, if you would like to change your server's endpoint, project ID, or self-signed certificate acceptance, use the client command.\", \" appwrite client --endpoint https://cloud.appwrite.io/v1\\nappwrite client --key 23f24gwrhSDgefaY\\nappwrite client --selfSigned true\\nappwrite client --reset // Resets your CLI configuration\\nappwrite client --debug // Prints your current configuration\"]}]", "metadata": {"source": "https://appwrite.io/docs/command-line"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Appwrite CLI \", \"body\": [\"The Appwrite CLI is a command-line application that allows you to interact with the Appwrite server and perform server-side tasks using your terminal. This includes creating and managing projects, managing resources (documents, files, users), creating and deploying Appwrite Functions, and other operations available through Appwrite's API.\"]}, {\"level\": 2, \"title\": \"Installation\", \"body\": [\"The CLI is packaged both as an npm module as well as a standalone binary for your operating system, making it completely dependency free, platform independent and language agnostic.\", \"If you plan to use the CLI to initialize new Appwrite Functions, ensure that Git is installed on your machine.\"]}, {\"level\": 3, \"title\": \"Install with NPM\", \"body\": [\"If you have npm set up, run the command below to install the CLI\", \" npm install -g appwrite-cli\"]}, {\"level\": 3, \"title\": \"Install with Script\", \"body\": [\"For a completely dependency-free installation, the CLI also ships with a convenient installation script for your operating system\", \" MacOS Using Homebrew brew tap appwrite/sdk-for-cli https://github.com/appwrite/sdk-for-cli\\nbrew update\\nbrew install --HEAD appwrite or terminal curl -sL https://appwrite.io/cli/install.sh | bash Windows iwr -useb https://appwrite.io/cli/install.ps1 | iex Linux curl -sL https://appwrite.io/cli/install.sh | bash \", \"After the installation is complete, verify the install using\", \" appwrite -v\"]}, {\"level\": 2, \"title\": \"Getting Started\", \"body\": [\"Before you can use the CLI, you need to login to your Appwrite account using\", \" appwrite login\", \" Self-Signed Certificates By default, requests to domains with self-signed SSL certificates (or no certificates) are disabled. If you trust the domain, you can bypass the certificate validation using appwrite client --selfSigned true \", \"You can run your first CLI command after logging in. Try fetching information about your Appwrite project.\", \" appwrite projects get --projectId [PROJECT_ID]\"]}, {\"level\": 2, \"title\": \"Next Steps\", \"body\": [\"You can use the CLI to create and deploy functions and collections. Deploy commands allow you to configure your Appwrite project programmatically and replicate functions and collection schemas across Appwrite projects.\", \"Learn more about deployment\", \"Besides utility commands, the CLI can be used to execute commands like a Server SDK.\", \"Find a full list of commands\", \"You can choose to use the CLI in a headless and non-interactive mode without the need for config files or sessions. This is useful for CI or scripting use cases.\", \"Learn more about CI mode\"]}, {\"level\": 2, \"title\": \"Help\", \"body\": [\"If you get stuck anywhere, you can always use the help command to get the usage examples.\"]}, {\"level\": 2, \"title\": \"Configuration\", \"body\": [\"At any point, if you would like to change your server's endpoint, project ID, or self-signed certificate acceptance, use the client command.\", \" appwrite client --endpoint https://cloud.appwrite.io/v1\\nappwrite client --key 23f24gwrhSDgefaY\\nappwrite client --selfSigned true\\nappwrite client --reset // Resets your CLI configuration\\nappwrite client --debug // Prints your current configuration\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/command-line"}} \ No newline at end of file diff --git a/docs/ee439a68-1f0c-11ee-98fa-00155da08df7.json b/docs/4eebe69e-4583-11ee-9922-f2ea36f81204.json similarity index 78% rename from docs/ee439a68-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eebe69e-4583-11ee-9922-f2ea36f81204.json index e3317a1..449ee84 100644 --- a/docs/ee439a68-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eebe69e-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Deployment \", \"body\": [\"The Apprite CLI allows you to create and deploy databases, collections, buckets, teams and functions to your Appwrite project from a configuration file. This is especially helpful if you're trying to track project setup using version control.\"]}]", "metadata": {"source": "https://appwrite.io/docs/command-line-deployment"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Deployment \", \"body\": [\"The Apprite CLI allows you to create and deploy databases, collections, buckets, teams and functions to your Appwrite project from a configuration file. This is especially helpful if you're trying to track project setup using version control.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/command-line-deployment"}} \ No newline at end of file diff --git a/docs/ee439bee-1f0c-11ee-98fa-00155da08df7.json b/docs/4eebed24-4583-11ee-9922-f2ea36f81204.json similarity index 96% rename from docs/ee439bee-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eebed24-4583-11ee-9922-f2ea36f81204.json index b94d022..405c9a5 100644 --- a/docs/ee439bee-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eebed24-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Commands \", \"body\": [\"Other than commands to create and deploy databases, collections, functions, teams, and buckets, the Appwrite CLI can be used as a Server SDK as well. The Appwrite CLI has a command for every Server API endpoint.\", \"Commands follows the following general syntax:\", \" appwrite [COMMAND] --[OPTIONS]\"]}, {\"level\": 2, \"title\": \"List of Commands\", \"body\": [\" Command Description login The login command allows you to authenticate into the CLI. This command expects the console account that you use to log into the Appwrite Console. init The init command helps you initialize your Appwrite project, databases, collections, functions, teams, and buckets. deploy The deploy command provides a convenient wrapper for deploying your databases, collections, functions, teams, and buckets. logout The logout command allows you to logout from the CLI. projects The projects command allows you to view, create, and manage your Appwrite projects. storage The storage command allows you to manage your project files. teams The teams command allows you to group users of your project and to enable them to share access permissions to your project's resources. users The users command allows you to manage your project users. client The client command allows you to configure your CLI. account The account command allows you to authenticate as and manage a user account. avatars The avatars command provides utilities to manage images, icons, and avatars. functions The functions command allows you view, create and manage your Appwrite Functions. databases The databases command allows you to create structured collections of documents, query and filter lists of documents. health The health command allows you to both validate and monitor your Appwrite project's health. locale The locale command allows you to customize your app based on your users' location. \"]}]", "metadata": {"source": "https://appwrite.io/docs/command-line-commands"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Commands \", \"body\": [\"Other than commands to create and deploy databases, collections, functions, teams, and buckets, the Appwrite CLI can be used as a Server SDK as well. The Appwrite CLI has a command for every Server API endpoint.\", \"Commands follows the following general syntax:\", \" appwrite [COMMAND] --[OPTIONS]\"]}, {\"level\": 2, \"title\": \"List of Commands\", \"body\": [\" Command Description login The login command allows you to authenticate into the CLI. This command expects the console account that you use to log into the Appwrite Console. init The init command helps you initialize your Appwrite project, databases, collections, functions, teams, and buckets. deploy The deploy command provides a convenient wrapper for deploying your databases, collections, functions, teams, and buckets. logout The logout command allows you to logout from the CLI. projects The projects command allows you to view, create, and manage your Appwrite projects. storage The storage command allows you to manage your project files. teams The teams command allows you to group users of your project and to enable them to share access permissions to your project's resources. users The users command allows you to manage your project users. client The client command allows you to configure your CLI. account The account command allows you to authenticate as and manage a user account. avatars The avatars command provides utilities to manage images, icons, and avatars. functions The functions command allows you view, create and manage your Appwrite Functions. databases The databases command allows you to create structured collections of documents, query and filter lists of documents. health The health command allows you to both validate and monitor your Appwrite project's health. locale The locale command allows you to customize your app based on your users' location. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/command-line-commands"}} \ No newline at end of file diff --git a/docs/ee439d7e-1f0c-11ee-98fa-00155da08df7.json b/docs/4eebf56c-4583-11ee-9922-f2ea36f81204.json similarity index 93% rename from docs/ee439d7e-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eebf56c-4583-11ee-9922-f2ea36f81204.json index beeed43..b77b0fa 100644 --- a/docs/ee439d7e-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eebf56c-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" CI Mode \", \"body\": [\"The Appwrite CLI can be used in a non-interactive and headless manner, without saving configuration or sessions. This is especially useful when you want to automate tasks on a CI server.\"]}, {\"level\": 2, \"title\": \"CI Mode\", \"body\": [\"You can enable CI mode for the Appwrite CLI by setting the project ID, endpoint, and API Key:\", \" appwrite client \\\\\\n --endpoint https://cloud.appwrite.io/v1 \\\\\\n --projectId [YOUR_PROJECT_ID] \\\\\\n --key YOUR_API_KEY\", \"When you set the global configuration parameters using the appwrite client command, they take precedence over the local configuration parameters in your appwrite.json thereby switching the CLI to non-interactive mode. \", \"In this mode, the CLI can only interact with one project at a time.\"]}, {\"level\": 2, \"title\": \"API Keys\", \"body\": [\"In CI mode, the CLI uses an API key to authenticate. Your API key must have sufficient permissions to execute the commands you plan to use. Learn more about API Keys.\"]}]", "metadata": {"source": "https://appwrite.io/docs/command-line-ci"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" CI Mode \", \"body\": [\"The Appwrite CLI can be used in a non-interactive and headless manner, without saving configuration or sessions. This is especially useful when you want to automate tasks on a CI server.\"]}, {\"level\": 2, \"title\": \"CI Mode\", \"body\": [\"You can enable CI mode for the Appwrite CLI by setting the project ID, endpoint, and API Key:\", \" appwrite client \\\\\\n --endpoint https://cloud.appwrite.io/v1 \\\\\\n --projectId [YOUR_PROJECT_ID] \\\\\\n --key YOUR_API_KEY\", \"When you set the global configuration parameters using the appwrite client command, they take precedence over the local configuration parameters in your appwrite.json thereby switching the CLI to non-interactive mode. \", \"In this mode, the CLI can only interact with one project at a time.\"]}, {\"level\": 2, \"title\": \"API Keys\", \"body\": [\"In CI mode, the CLI uses an API key to authenticate. Your API key must have sufficient permissions to execute the commands you plan to use. Learn more about API Keys.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/command-line-ci"}} \ No newline at end of file diff --git a/docs/ee439f04-1f0c-11ee-98fa-00155da08df7.json b/docs/4eebfd50-4583-11ee-9922-f2ea36f81204.json similarity index 60% rename from docs/ee439f04-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eebfd50-4583-11ee-9922-f2ea36f81204.json index 07f0300..df01b24 100644 --- a/docs/ee439f04-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eebfd50-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" SDKs \", \"body\": [\"We provide libraries for major programming languages and platforms so you don't have to write code for interacting with our HTTP APIs from scratch.\", \"Our team is always working on improving and extending the current stack of available platforms and SDKs, listed below is a list of official libraries our team is currently maintaining.\", \" Client SDKs Server SDKs \"]}, {\"level\": 2, \"title\": \"Client SDKs\", \"body\": [\"Client libraries for integrating with Appwrite to build client-based applications and websites. Read the getting started for web or getting started for Flutter tutorials to start building your first application.\", \" Platform GitHub Repository Web SDK \\u00a011.0.0 appwrite/sdk-for-web official Flutter SDK \\u00a09.0.0 appwrite/sdk-for-flutter official Apple SDK \\u00a02.0.0 appwrite/sdk-for-apple official Android SDK \\u00a02.0.0 appwrite/sdk-for-android official \"]}, {\"level\": 2, \"title\": \"Server SDKs\", \"body\": [\"Libraries for integrating with Appwrite to build server side integrations. Read the getting started for server tutorial to start building your first server integration.\", \" Platform GitHub Repository Node.js SDK \\u00a09.0.0 appwrite/sdk-for-node official Deno SDK \\u00a07.0.0 appwrite/sdk-for-deno official PHP SDK \\u00a08.0.0 appwrite/sdk-for-php official Python SDK \\u00a02.0.0 appwrite/sdk-for-python official Ruby SDK \\u00a08.0.0 appwrite/sdk-for-ruby official .NET SDK \\u00a00.4.0 appwrite/sdk-for-dotnet official beta Dart SDK \\u00a08.0.0 appwrite/sdk-for-dart official Kotlin SDK \\u00a02.0.0 appwrite/sdk-for-kotlin official Swift SDK \\u00a02.0.0 appwrite/sdk-for-swift official \", \"If you would like to help us extend our platforms and SDKs stack, you are more than welcome to contact us or check out our Appwrite SDK Generator project GitHub repository and read our contribution guide.\"]}, {\"level\": 2, \"title\": \"Integrate without an SDK\", \"body\": [\"We are always looking to add new SDKs to our platform, but if the SDK you are looking for is still missing or in a beta channel, you can always integrate with Appwrite directly using any standard HTTP client and the Appwrite REST API. You can learn more about how you can integrate directly with Appwrite HTTP API from our dedicated blog post on the topic.\"]}]", "metadata": {"source": "https://appwrite.io/docs/sdks"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" SDKs \", \"body\": [\"We provide libraries for major programming languages and platforms so you don't have to write code for interacting with our HTTP APIs from scratch.\", \"Our team is always working on improving and extending the current stack of available platforms and SDKs, listed below is a list of official libraries our team is currently maintaining.\", \" Client SDKs Server SDKs \"]}, {\"level\": 2, \"title\": \"Client SDKs\", \"body\": [\"Client libraries for integrating with Appwrite to build client-based applications and websites. Read the getting started for web or getting started for Flutter tutorials to start building your first application.\", \" Platform GitHub Repository Web SDK \\u00a011.0.0 appwrite/sdk-for-web official Flutter SDK \\u00a09.0.0 appwrite/sdk-for-flutter official Apple SDK \\u00a02.0.0 appwrite/sdk-for-apple official Android SDK \\u00a02.0.0 appwrite/sdk-for-android official \"]}, {\"level\": 2, \"title\": \"Server SDKs\", \"body\": [\"Libraries for integrating with Appwrite to build server side integrations. Read the getting started for server tutorial to start building your first server integration.\", \" Platform GitHub Repository Node.js SDK \\u00a09.0.0 appwrite/sdk-for-node official Deno SDK \\u00a07.0.0 appwrite/sdk-for-deno official PHP SDK \\u00a08.0.0 appwrite/sdk-for-php official Python SDK \\u00a02.0.2 appwrite/sdk-for-python official Ruby SDK \\u00a08.0.0 appwrite/sdk-for-ruby official .NET SDK \\u00a00.4.2 appwrite/sdk-for-dotnet official experimental Dart SDK \\u00a08.0.0 appwrite/sdk-for-dart official Kotlin SDK \\u00a02.0.0 appwrite/sdk-for-kotlin official Swift SDK \\u00a02.0.0 appwrite/sdk-for-swift official \", \"If you would like to help us extend our platforms and SDKs stack, you are more than welcome to contact us or check out our Appwrite SDK Generator project GitHub repository and read our contribution guide.\"]}, {\"level\": 2, \"title\": \"Integrate without an SDK\", \"body\": [\"We are always looking to add new SDKs to our platform, but if the SDK you are looking for is still missing or is labeled experimental, you can always integrate with Appwrite directly using any standard HTTP client and the Appwrite REST API. You can learn more about how you can integrate directly with Appwrite HTTP API from our dedicated blog post on the topic.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/sdks"}} \ No newline at end of file diff --git a/docs/ee43a0a8-1f0c-11ee-98fa-00155da08df7.json b/docs/4eec04f8-4583-11ee-9922-f2ea36f81204.json similarity index 91% rename from docs/ee43a0a8-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eec04f8-4583-11ee-9922-f2ea36f81204.json index 68b6846..104f43a 100644 --- a/docs/ee43a0a8-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eec04f8-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" REST API \", \"body\": [\"Appwrite supports multiple protocols for accessing the server, including REST, GraphQL, and Realtime.\", \"The REST API allows you to access your Appwrite server through HTTP requests without the needing an SDK. Each endpoint in the API represents a specific operation on a specific resource.\"]}, {\"level\": 2, \"title\": \"Headers\", \"body\": [\"Appwrite's REST APIs expect certain headers to be included with each request:\", \" Header Description X-Appwrite-Project: [PROJECT-ID] required The ID of your Appwrite project Content-Type: application/json required Content type of the HTTP request. X-Appwrite-Key: [API-KEY] optional API key used for server authentication. Do not use API keys in client applications. X-Appwrite-JWT: [TOKEN] optional Token used for JWT authentication, tokens can be generated using the Create JWT endpoint. X-Appwrite-Response-Format: [VERSION-NUMBER] optional Version number used for backward compatibility. The response will be formatted to be compatible with the provided version number. X-Fallback-Cookies: [FALLBACK-COOKIES] optional Fallback cookies used in scenarios where browsers do not allow third-party cookies. Often used when there is no Custom Domain. \"]}, {\"level\": 2, \"title\": \"Using Appwrite Without Headers\", \"body\": [\"Some use cases do not allow custom headers, such as embedding images from Appwrite in HTML. In these cases, you can provide the Appwrite project ID using the query parameter project.\", \" \"]}, {\"level\": 2, \"title\": \"Client Authentication\", \"body\": [\"You can create account sessions with POST requests to the Account API. Sessions are persisted using secured cookies. You can learn more about session persistence in the Authentication Guide.\", \"The example below shows creating an account session with the Create Account Session with Email endpoint.\", \" POST /v1/account/sessions/email HTTP/1.1\\nContent-Type: application/json\\nX-Appwrite-Project: [PROJECT_ID]\\n\\n{\\n \\\"email\\\": \\\"example@email.com\\\",\\n \\\"password\\\": \\\"password\\\"\\n}\", \" You can find the cookies used to persist the new session in the response headers.\", \" Set-Cookie: a_session_61e71ec784ab035f7259_legacy=eyJ0...aSJ9; expires=Tue, 19-Dec-2023 21:26:51 GMT; path=/; domain=.cloud.appwrite.io; secure; httponly\\nSet-Cookie: a_session_61e71ec784ab035f7259=eyJ0...aSJ9; expires=Tue, 19-Dec-2023 21:26:51 GMT; path=/; domain=.cloud.appwrite.io; secure; httponly; samesite=None\", \"These cookies are used in subsequent requests to authenticate the user.\", \" GET /v1/account HTTP/1.1\\nCookie: a_session_61e71ec784ab035f7259_legacy=eyJ0...aSJ9; a_session_61e71ec784ab035f7259=eyJ0...aSJ9\\nContent-Type: application/json\\nX-Appwrite-Project: [PROJECT_ID]\"]}, {\"level\": 2, \"title\": \"Server Authentication\", \"body\": [\"Server integrations use API keys to authenticate and are typically used for backend applications.\", \"Server APIs are authenticated with API keys instead of account sessions. Simply pass an API key in the X-Appwrite-key: [API-KEY] header with the appropriate scopes.\", \" GET /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1\\nContent-Type: application/json\\nX-Appwrite-Project: [PROJECT_ID]\\nX-Appwrite-Key: [API_KEY]\"]}, {\"level\": 2, \"title\": \"JWT Authentication\", \"body\": [\"JWT authentication is frequently used by server applications to act on behalf of a user. Users generate tokens using the Create JWT endpoint. When issuing requests authenticated with a JWT, Appwrite will treat the request like it is from the authenticated user.\", \" GET /v1/account HTTP/1.1\\nContent-Type: application/json\\nX-Appwrite-Project: [PROJECT_ID]\\nX-Appwrite-JWT: [TOKEN]\"]}, {\"level\": 2, \"title\": \"File Handling\", \"body\": [\"Appwrite implements resumable, chunked uploads for files larger than 5MB. Chunked uploads send files in chunks of 5MB to reduce memory footprint and increase resilience when handling large files. Appwrite SDKs will automatically handle chunked uploads, but it is possible to implement this with the REST API directly.\", \"Upload endpoints in Appwrite, such as Create File and Create Deployment, are different from other endpoints. These endpoints take multipart form data instead of JSON data. To implement chunked uploads, you will need to implement the following headers:\", \" Header Description X-Appwrite-Project: [PROJECT-ID] required Contains the ID of your Appwrite Project to the REST API. Content-Type: multipart/form-data; boundary=[FORM-BOUNDARY] required Contains the content type of the HTTP request and provides a boundary that is used to parse the form data. Content-Range: bytes [BYTE-RANGE] required Contains information about which bytes are being transmitted in this chunk, with the format [FIRST-BYTE]-[LAST-BYTE]/[TOTAL-BYTES]. X-Appwrite-ID: [FILE-ID] required Contains ID of the file this chunk belongs to. X-Appwrite-Key: [API-KEY] optional Used for authentication in server integrations. Do not use API keys in client applications. \", \"The multipart form data is structured as follows:\", \" Key Value File Name Description fileId optional [FILE-ID] n/a Contains the file ID of the new file. Only used by file chunks following the first chunk uploaded. file required [CHUNK-DATA] [FILE-NAME] Contains file chunk data. permissions required [PERMISSION ARRAY] n/a Contains an array of permission strings about who can access the new file. \", \"While cURL and fetch are great tools to explore other REST endpoints, it's impractical to use for chunked file uploads because you need to split files into chunks.\", \"The multipart form data posted to file upload endpoints have the following format:\", \" POST /v1/storage/buckets/default/files HTTP/1.1\\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundarye0m6iNBQNHlzTpVM\\nX-Appwrite-Project: demo-project\\nContent-Range: bytes 10485760-12582912/12582912\\nX-Appwrite-ID: 6369b0bc1dcf4ff59051\\n\\n------WebKitFormBoundarye0m6iNBQNHlzTpVM\\nContent-Disposition: form-data; name=\\\"fileId\\\"\\n\\nunique()\\n------WebKitFormBoundarye0m6iNBQNHlzTpVM\\nContent-Disposition: form-data; name=\\\"file\\\"; filename=\\\"file.txt\\\"\\nContent-Type: application/octet-stream\\n\\n[CHUNKED-DATA]\\n------WebKitFormBoundarye0m6iNBQNHlzTpVM\\nContent-Disposition: form-data; name=\\\"permissions[]\\\"\\n\\nread(\\\"user:627a958ded6424a98a9f\\\")\\n------WebKitFormBoundarye0m6iNBQNHlzTpVM--\"]}, {\"level\": 2, \"title\": \"Permissions\", \"body\": [\"Appwrite SDKs have helpers to generate permission strings, but when using Appwrite without SDKs, you'd need to create the strings yourself.\"]}, {\"level\": 3, \"title\": \"Permission Types\", \"body\": [\" SDK Permission String Permission.read() read(\\\"[PERMISSION_ROLE]\\\") Permission.create() create(\\\"[PERMISSION_ROLE]\\\") Permission.update() update(\\\"[PERMISSION_ROLE]\\\") Permission.delete() delete(\\\"[PERMISSION_ROLE]\\\") Permission.write() write(\\\"[PERMISSION_ROLE]\\\") \"]}, {\"level\": 3, \"title\": \"Permission Roles\", \"body\": [\" SDK Role String Role.any() any Role.guests() guests Role.users() users Role.users([STATUS]) users/[STATUS] Role.user([USER_ID]) user:[USER_ID] Role.user([USER_ID], [STATUS]) user:[USER_ID]/[STATUS] Role.team([TEAM_ID]) team:[TEAM_ID] Role.team([TEAM_ID], [ROLE]) team:[TEAM_ID]/[ROLE] Role.member([MEMBERSHIP_ID]) member:[MEMBERSHIP_ID] \", \" Learn more about permissions\"]}, {\"level\": 2, \"title\": \"Unique ID\", \"body\": [\"Appwrite's SDKs have a helper ID.unique() to generate unique IDs. When using Appwrite without an SDK, pass the string \\\"unique()\\\" into the ID parameter.\"]}, {\"level\": 2, \"title\": \"Query Methods\", \"body\": [\"Appwrite's SDKs provide a Query class to generate query strings. When using Appwrite without an SDK, you can template your own strings with the format below.\", \"Query strings are passed to Appwrite using the queries parameter. You can attach multiple query strings by including the array parameter multiple times in the query string: queries[]=\\\"...\\\"&queries[]=\\\"...\\\"\", \" Query Method Query String select select([attribute]) equal equal(\\\"attribute\\\", [value]) notEqual notEqual(\\\"attribute\\\", [value]) lessThan lessThan(\\\"attribute\\\", [value]) lessThanEqual lessThanEqual(\\\"attribute\\\", [value]) greaterThan greaterThan(\\\"attribute\\\", [value]) greaterThanEqual greaterThanEqual(\\\"attribute\\\", [value]) between between(\\\"attribute\\\", lowerBound, upperBound) isNull isNull(\\\"attribute\\\") isNotNull isNotNull(\\\"attribute\\\") startsWith startsWith(\\\"attribute\\\", [value]) endsWith endsWith(\\\"attribute\\\", [value]) search search(\\\"attribute\\\", [value]) orderDesc orderDesc(\\\"attribute\\\") orderAsc orderAsc(\\\"attribute\\\") cursorAfter cursorAfter(\\\"documentId\\\") cursorBefore cursorBefore(\\\"documentId\\\") limit limit(0) offset offset(0) \", \" Best Practice When using greater than, greater than or equal to, less than, or less than or equal to, it is not recommended to pass in multiple values. While the API will accept multiple values and return results with or logic, it's best practice to pass in only one value for performance reasons.\"]}]", "metadata": {"source": "https://appwrite.io/docs/rest"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" REST API \", \"body\": [\"Appwrite supports multiple protocols for accessing the server, including REST, GraphQL, and Realtime.\", \"The REST API allows you to access your Appwrite server through HTTP requests without the needing an SDK. Each endpoint in the API represents a specific operation on a specific resource.\"]}, {\"level\": 2, \"title\": \"Headers\", \"body\": [\"Appwrite's REST APIs expect certain headers to be included with each request:\", \" Header Description X-Appwrite-Project: [PROJECT-ID] required The ID of your Appwrite project Content-Type: application/json required Content type of the HTTP request. X-Appwrite-Key: [API-KEY] optional API key used for server authentication. Do not use API keys in client applications. X-Appwrite-JWT: [TOKEN] optional Token used for JWT authentication, tokens can be generated using the Create JWT endpoint. X-Appwrite-Response-Format: [VERSION-NUMBER] optional Version number used for backward compatibility. The response will be formatted to be compatible with the provided version number. X-Fallback-Cookies: [FALLBACK-COOKIES] optional Fallback cookies used in scenarios where browsers do not allow third-party cookies. Often used when there is no Custom Domain. \"]}, {\"level\": 2, \"title\": \"Using Appwrite Without Headers\", \"body\": [\"Some use cases do not allow custom headers, such as embedding images from Appwrite in HTML. In these cases, you can provide the Appwrite project ID using the query parameter project.\", \" \"]}, {\"level\": 2, \"title\": \"Client Authentication\", \"body\": [\"You can create account sessions with POST requests to the Account API. Sessions are persisted using secured cookies. You can learn more about session persistence in the Authentication Guide.\", \"The example below shows creating an account session with the Create Account Session with Email endpoint.\", \" POST /v1/account/sessions/email HTTP/1.1\\nContent-Type: application/json\\nX-Appwrite-Project: [PROJECT_ID]\\n\\n{\\n \\\"email\\\": \\\"example@email.com\\\",\\n \\\"password\\\": \\\"password\\\"\\n}\", \" You can find the cookies used to persist the new session in the response headers.\", \" Set-Cookie: a_session_61e71ec784ab035f7259_legacy=eyJ0...aSJ9; expires=Tue, 19-Dec-2023 21:26:51 GMT; path=/; domain=.cloud.appwrite.io; secure; httponly\\nSet-Cookie: a_session_61e71ec784ab035f7259=eyJ0...aSJ9; expires=Tue, 19-Dec-2023 21:26:51 GMT; path=/; domain=.cloud.appwrite.io; secure; httponly; samesite=None\", \"These cookies are used in subsequent requests to authenticate the user.\", \" GET /v1/account HTTP/1.1\\nCookie: a_session_61e71ec784ab035f7259_legacy=eyJ0...aSJ9; a_session_61e71ec784ab035f7259=eyJ0...aSJ9\\nContent-Type: application/json\\nX-Appwrite-Project: [PROJECT_ID]\"]}, {\"level\": 2, \"title\": \"Server Authentication\", \"body\": [\"Server integrations use API keys to authenticate and are typically used for backend applications.\", \"Server APIs are authenticated with API keys instead of account sessions. Simply pass an API key in the X-Appwrite-key: [API-KEY] header with the appropriate scopes.\", \" GET /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1\\nContent-Type: application/json\\nX-Appwrite-Project: [PROJECT_ID]\\nX-Appwrite-Key: [API_KEY]\"]}, {\"level\": 2, \"title\": \"JWT Authentication\", \"body\": [\"JWT authentication is frequently used by server applications to act on behalf of a user. Users generate tokens using the Create JWT endpoint. When issuing requests authenticated with a JWT, Appwrite will treat the request like it is from the authenticated user.\", \" GET /v1/account HTTP/1.1\\nContent-Type: application/json\\nX-Appwrite-Project: [PROJECT_ID]\\nX-Appwrite-JWT: [TOKEN]\"]}, {\"level\": 2, \"title\": \"File Handling\", \"body\": [\"Appwrite implements resumable, chunked uploads for files larger than 5MB. Chunked uploads send files in chunks of 5MB to reduce memory footprint and increase resilience when handling large files. Appwrite SDKs will automatically handle chunked uploads, but it is possible to implement this with the REST API directly.\", \"Upload endpoints in Appwrite, such as Create File and Create Deployment, are different from other endpoints. These endpoints take multipart form data instead of JSON data. To implement chunked uploads, you will need to implement the following headers:\", \" Header Description X-Appwrite-Project: [PROJECT-ID] required Contains the ID of your Appwrite Project to the REST API. Content-Type: multipart/form-data; boundary=[FORM-BOUNDARY] required Contains the content type of the HTTP request and provides a boundary that is used to parse the form data. Content-Range: bytes [BYTE-RANGE] required Contains information about which bytes are being transmitted in this chunk, with the format [FIRST-BYTE]-[LAST-BYTE]/[TOTAL-BYTES]. X-Appwrite-ID: [FILE-ID] required Contains ID of the file this chunk belongs to. X-Appwrite-Key: [API-KEY] optional Used for authentication in server integrations. Do not use API keys in client applications. \", \"The multipart form data is structured as follows:\", \" Key Value File Name Description fileId optional [FILE-ID] n/a Contains the file ID of the new file. Only used by file chunks following the first chunk uploaded. file required [CHUNK-DATA] [FILE-NAME] Contains file chunk data. permissions required [PERMISSION ARRAY] n/a Contains an array of permission strings about who can access the new file. \", \"While cURL and fetch are great tools to explore other REST endpoints, it's impractical to use for chunked file uploads because you need to split files into chunks.\", \"The multipart form data posted to file upload endpoints have the following format:\", \" POST /v1/storage/buckets/default/files HTTP/1.1\\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundarye0m6iNBQNHlzTpVM\\nX-Appwrite-Project: demo-project\\nContent-Range: bytes 10485760-12582912/12582912\\nX-Appwrite-ID: 6369b0bc1dcf4ff59051\\n\\n------WebKitFormBoundarye0m6iNBQNHlzTpVM\\nContent-Disposition: form-data; name=\\\"fileId\\\"\\n\\nunique()\\n------WebKitFormBoundarye0m6iNBQNHlzTpVM\\nContent-Disposition: form-data; name=\\\"file\\\"; filename=\\\"file.txt\\\"\\nContent-Type: application/octet-stream\\n\\n[CHUNKED-DATA]\\n------WebKitFormBoundarye0m6iNBQNHlzTpVM\\nContent-Disposition: form-data; name=\\\"permissions[]\\\"\\n\\nread(\\\"user:627a958ded6424a98a9f\\\")\\n------WebKitFormBoundarye0m6iNBQNHlzTpVM--\"]}, {\"level\": 2, \"title\": \"Permissions\", \"body\": [\"Appwrite SDKs have helpers to generate permission strings, but when using Appwrite without SDKs, you'd need to create the strings yourself.\"]}, {\"level\": 3, \"title\": \"Permission Types\", \"body\": [\" SDK Permission String Permission.read() read(\\\"[PERMISSION_ROLE]\\\") Permission.create() create(\\\"[PERMISSION_ROLE]\\\") Permission.update() update(\\\"[PERMISSION_ROLE]\\\") Permission.delete() delete(\\\"[PERMISSION_ROLE]\\\") Permission.write() write(\\\"[PERMISSION_ROLE]\\\") \"]}, {\"level\": 3, \"title\": \"Permission Roles\", \"body\": [\" SDK Role String Role.any() any Role.guests() guests Role.users() users Role.users([STATUS]) users/[STATUS] Role.user([USER_ID]) user:[USER_ID] Role.user([USER_ID], [STATUS]) user:[USER_ID]/[STATUS] Role.team([TEAM_ID]) team:[TEAM_ID] Role.team([TEAM_ID], [ROLE]) team:[TEAM_ID]/[ROLE] Role.member([MEMBERSHIP_ID]) member:[MEMBERSHIP_ID] \", \" Learn more about permissions\"]}, {\"level\": 2, \"title\": \"Unique ID\", \"body\": [\"Appwrite's SDKs have a helper ID.unique() to generate unique IDs. When using Appwrite without an SDK, pass the string \\\"unique()\\\" into the ID parameter.\"]}, {\"level\": 2, \"title\": \"Query Methods\", \"body\": [\"Appwrite's SDKs provide a Query class to generate query strings. When using Appwrite without an SDK, you can template your own strings with the format below.\", \"Query strings are passed to Appwrite using the queries parameter. You can attach multiple query strings by including the array parameter multiple times in the query string: queries[]=\\\"...\\\"&queries[]=\\\"...\\\"\", \" Query Method Query String select select([attribute]) equal equal(\\\"attribute\\\", [value]) notEqual notEqual(\\\"attribute\\\", [value]) lessThan lessThan(\\\"attribute\\\", [value]) lessThanEqual lessThanEqual(\\\"attribute\\\", [value]) greaterThan greaterThan(\\\"attribute\\\", [value]) greaterThanEqual greaterThanEqual(\\\"attribute\\\", [value]) between between(\\\"attribute\\\", lowerBound, upperBound) isNull isNull(\\\"attribute\\\") isNotNull isNotNull(\\\"attribute\\\") startsWith startsWith(\\\"attribute\\\", [value]) endsWith endsWith(\\\"attribute\\\", [value]) search search(\\\"attribute\\\", [value]) orderDesc orderDesc(\\\"attribute\\\") orderAsc orderAsc(\\\"attribute\\\") cursorAfter cursorAfter(\\\"documentId\\\") cursorBefore cursorBefore(\\\"documentId\\\") limit limit(0) offset offset(0) \", \" Best Practice When using greater than, greater than or equal to, less than, or less than or equal to, it is not recommended to pass in multiple values. While the API will accept multiple values and return results with or logic, it's best practice to pass in only one value for performance reasons.\"]}, {\"level\": 2, \"title\": \"Rate Limits\", \"body\": [\"Appwrite's REST APIs are protected by the same rate limit policies, just like when using SDKs. Each API has a different rate limit, which is documented in the References section of each service in the Appwrite documentation.\", \" Learn more about Rate Limits\"]}, {\"level\": 2, \"title\": \"Stateless\", \"body\": [\"Appwrite's REST APIs are stateless. Each time you make a request, Appwrite receives all the information it needs to perform the action, regardless of what requests you make before and after that request.\", \"Since each requests is stateless, they can be handled in any given order when sent concurrently, as long as they don't make conflicting changes to the same resource.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/rest"}} \ No newline at end of file diff --git a/docs/ee43a314-1f0c-11ee-98fa-00155da08df7.json b/docs/4eec14de-4583-11ee-9922-f2ea36f81204.json similarity index 98% rename from docs/ee43a314-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eec14de-4583-11ee-9922-f2ea36f81204.json index 438d002..70d72a2 100644 --- a/docs/ee43a314-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eec14de-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" GraphQL \", \"body\": [\"Appwrite supports multiple protocols for accessing the server, including REST, GraphQL, and Realtime.\", \"The GraphQL API allows you to query and mutate any resource type on your Appwrite server through the endpoint /v1/graphql. Every endpoint available through REST is available through GraphQL, except for OAuth.\"]}, {\"level\": 2, \"title\": \"Requests\", \"body\": [\"Although every query executes through the same endpoint, there are multiple ways to make a GraphQL request. All requests, however, share a common structure.\", \" Name Type Description query required string The GraphQL query to execute. operationName optional string If the query contains several named operations, controls which one to execute. variables optional object An object containing variable names and values for the query. Variables are made available to your query with the $ prefix. \", \" GraphQL Model Parameters In Appwrite's GraphQL API, all internal model parameters are prefixed with _ instead of $ because $ is reserved by GraphQL. For example, $collectionId in the REST API would be referenced as _collectionId in the GraphQL API.\"]}, {\"level\": 3, \"title\": \"GET Requests\", \"body\": [\"You can execute a GraphQL query via a GET request, passing a query and optionally operationName and variables as query parameters.\"]}, {\"level\": 3, \"title\": \"POST Requests\", \"body\": [\"There are multiple ways to make a GraphQL POST request, differentiated by content type.\"]}, {\"level\": 4, \"title\": \"JSON\", \"body\": [\"There are two ways to make requests with the application/json content type. You can send a JSON object containing a query and optionally operationName and variables, or an array of objects with the same structure.\", \" Object {\\n \\\"query\\\": \\\"\\\",\\n \\\"operationName\\\": \\\"\\\",\\n \\\"variables\\\": {}\\n} Array [\\n {\\n \\\"query\\\": \\\"\\\",\\n \\\"operationName\\\": \\\"\\\",\\n \\\"variables\\\": {}\\n }\\n] \"]}, {\"level\": 4, \"title\": \"GraphQL\", \"body\": [\"The application/graphql content type can be used to send a query as the raw POST body.\", \" query GetAccount {\\n accountGet {\\n _id\\n email\\n }\\n}\"]}, {\"level\": 4, \"title\": \"Multipart Form Data\", \"body\": [\"The multipart/form-data content type can be used to upload files via GraphQL. In this case, the form data must include the following parts in addition to the files to upload:\", \" Name Type Description operations required string JSON encoded GraphQL query and optionally operation name and variables. File variables should contain null values. map required string JSON encoded map of form-data filenames to the operations dot-path to inject the file to, e.g. variables.file. \"]}, {\"level\": 2, \"title\": \"Responses\", \"body\": [\"A response to a GraphQL request will have the following structure:\", \" Name Type Description data object The data returned by the query, maps requested field names to their results. errors object[] An array of errors that occurred during the request. \", \"The data object will contain a map of requested field names to their results. If no data is returned, the object will not be present in the response.\", \"The errors array will contain error objects, each with their own message and path. The path will contain the field key that is null due to the error. If no errors occur, the array will not be present in the response.\"]}, {\"level\": 2, \"title\": \"Authentication\", \"body\": [\"GraphQL authenticates using Appwrite accounts and sessions. Both accounts and sessions can be created with GraphQL using the accountCreate, accountCreateEmailSession, accountCreateAnonymousSession, or accountCreatePhoneSession mutations.\", \"More information and examples of authenticating users can be found in the dedicated authentication guide.\"]}, {\"level\": 2, \"title\": \"GraphQL vs REST\", \"body\": [\"There are two main features that make GraphQL appealing when compared to the REST API: selection sets and query batching.\"]}, {\"level\": 3, \"title\": \"Selection Sets\", \"body\": [\"Selection sets can be used to tell a GraphQL API exactly which fields of a particular resource you would like to receive in the response. The server will respond with only those fields, nothing more, nothing less. This gives you full control over what data comes into your application.\", \"For example, to retrieve only the email of a currently authenticated user, you could query the accountGet field, passing only email as the field selection set.\", \" query GetAccount {\\n accountGet {\\n _id\\n email\\n }\\n}\", \"Given this query, the GraphQL API will respond with:\", \" {\\n \\\"data\\\": {\\n \\\"accountGet\\\": {\\n \\\"_id\\\": \\\"...\\\",\\n \\\"email\\\": \\\"...\\\"\\n }\\n }\\n}\", \"This can be a useful feature for performance, network efficiency, and app responsiveness. As the processing happens on the server, the bandwidth consumed for the request can be dramatically reduced.\"]}, {\"level\": 3, \"title\": \"Query Batching\", \"body\": [\"GraphQL allows sending multiple queries or mutations in the same request. There are two different ways to batch queries. The simplest way is to include multiple fields in a single query or mutation.\", \" query GetAccountAndLocale {\\n accountGet {\\n _id\\n email\\n }\\n localeGet {\\n ip\\n }\\n}\", \"If both field executions succeed, the response will contain a data key for each field, containing the values of the selected fields.\", \" {\\n \\\"data\\\": {\\n \\\"accountGet\\\": {\\n \\\"_id\\\": \\\"...\\\",\\n \\\"email\\\": \\\"...\\\"\\n },\\n \\\"localeGet\\\": {\\n \\\"ip\\\": \\\"...\\\"\\n }\\n }\\n}\", \"If there was no authenticated user, the accountGet field would fail to resolve. In such a case the value of the data key for that field will be null, and an object will be added to the errors array instead.\", \" {\\n \\\"data\\\": {\\n \\\"accountGet\\\": null,\\n \\\"localeGet\\\": {\\n \\\"ip\\\": \\\"...\\\",\\n \\\"country\\\": \\\"...\\\"\\n }\\n },\\n \\\"errors\\\": [\\n {\\n \\\"message\\\": \\\"User (role: guest) missing scope (account)\\\",\\n \\\"path\\\": [\\\"accountGet\\\"]\\n }\\n ]\\n}\", \"Batching with a single query or mutation has some down-sides. You can not mix and match queries and mutations within the same request unless you provide an operationName, in which case you can only execute one query per request.\", \"Additionally, all variables must be passed in the same object, which can be cumbersome and hard to maintain.\", \"The second way to batch is to pass an array of queries or mutations in the request. In this way, you can execute queries and mutations and keep variables separated for each.\", \" [\\n {\\n \\\"query\\\": \\\"query GetAccount { accountGet{ email } }\\\",\\n },\\n {\\n \\\"query\\\": \\\"query GetLocale { localeGet { ip } }\\\"\\n }\\n]\", \"This allows you to execute complex actions in a single network request.\"]}]", "metadata": {"source": "https://appwrite.io/docs/graphql"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" GraphQL \", \"body\": [\"Appwrite supports multiple protocols for accessing the server, including REST, GraphQL, and Realtime.\", \"The GraphQL API allows you to query and mutate any resource type on your Appwrite server through the endpoint /v1/graphql. Every endpoint available through REST is available through GraphQL, except for OAuth.\"]}, {\"level\": 2, \"title\": \"Requests\", \"body\": [\"Although every query executes through the same endpoint, there are multiple ways to make a GraphQL request. All requests, however, share a common structure.\", \" Name Type Description query required string The GraphQL query to execute. operationName optional string If the query contains several named operations, controls which one to execute. variables optional object An object containing variable names and values for the query. Variables are made available to your query with the $ prefix. \", \" GraphQL Model Parameters In Appwrite's GraphQL API, all internal model parameters are prefixed with _ instead of $ because $ is reserved by GraphQL. For example, $collectionId in the REST API would be referenced as _collectionId in the GraphQL API.\"]}, {\"level\": 3, \"title\": \"GET Requests\", \"body\": [\"You can execute a GraphQL query via a GET request, passing a query and optionally operationName and variables as query parameters.\"]}, {\"level\": 3, \"title\": \"POST Requests\", \"body\": [\"There are multiple ways to make a GraphQL POST request, differentiated by content type.\"]}, {\"level\": 4, \"title\": \"JSON\", \"body\": [\"There are two ways to make requests with the application/json content type. You can send a JSON object containing a query and optionally operationName and variables, or an array of objects with the same structure.\", \" Object {\\n \\\"query\\\": \\\"\\\",\\n \\\"operationName\\\": \\\"\\\",\\n \\\"variables\\\": {}\\n} Array [\\n {\\n \\\"query\\\": \\\"\\\",\\n \\\"operationName\\\": \\\"\\\",\\n \\\"variables\\\": {}\\n }\\n] \"]}, {\"level\": 4, \"title\": \"GraphQL\", \"body\": [\"The application/graphql content type can be used to send a query as the raw POST body.\", \" query GetAccount {\\n accountGet {\\n _id\\n email\\n }\\n}\"]}, {\"level\": 4, \"title\": \"Multipart Form Data\", \"body\": [\"The multipart/form-data content type can be used to upload files via GraphQL. In this case, the form data must include the following parts in addition to the files to upload:\", \" Name Type Description operations required string JSON encoded GraphQL query and optionally operation name and variables. File variables should contain null values. map required string JSON encoded map of form-data filenames to the operations dot-path to inject the file to, e.g. variables.file. \"]}, {\"level\": 2, \"title\": \"Responses\", \"body\": [\"A response to a GraphQL request will have the following structure:\", \" Name Type Description data object The data returned by the query, maps requested field names to their results. errors object[] An array of errors that occurred during the request. \", \"The data object will contain a map of requested field names to their results. If no data is returned, the object will not be present in the response.\", \"The errors array will contain error objects, each with their own message and path. The path will contain the field key that is null due to the error. If no errors occur, the array will not be present in the response.\"]}, {\"level\": 2, \"title\": \"Authentication\", \"body\": [\"GraphQL authenticates using Appwrite accounts and sessions. Both accounts and sessions can be created with GraphQL using the accountCreate, accountCreateEmailSession, accountCreateAnonymousSession, or accountCreatePhoneSession mutations.\", \"More information and examples of authenticating users can be found in the dedicated authentication guide.\"]}, {\"level\": 2, \"title\": \"GraphQL vs REST\", \"body\": [\"There are two main features that make GraphQL appealing when compared to the REST API: selection sets and query batching.\"]}, {\"level\": 3, \"title\": \"Selection Sets\", \"body\": [\"Selection sets can be used to tell a GraphQL API exactly which fields of a particular resource you would like to receive in the response. The server will respond with only those fields, nothing more, nothing less. This gives you full control over what data comes into your application.\", \"For example, to retrieve only the email of a currently authenticated user, you could query the accountGet field, passing only email as the field selection set.\", \" query GetAccount {\\n accountGet {\\n _id\\n email\\n }\\n}\", \"Given this query, the GraphQL API will respond with:\", \" {\\n \\\"data\\\": {\\n \\\"accountGet\\\": {\\n \\\"_id\\\": \\\"...\\\",\\n \\\"email\\\": \\\"...\\\"\\n }\\n }\\n}\", \"This can be a useful feature for performance, network efficiency, and app responsiveness. As the processing happens on the server, the bandwidth consumed for the request can be dramatically reduced.\"]}, {\"level\": 3, \"title\": \"Query Batching\", \"body\": [\"GraphQL allows sending multiple queries or mutations in the same request. There are two different ways to batch queries. The simplest way is to include multiple fields in a single query or mutation.\", \" query GetAccountAndLocale {\\n accountGet {\\n _id\\n email\\n }\\n localeGet {\\n ip\\n }\\n}\", \"If both field executions succeed, the response will contain a data key for each field, containing the values of the selected fields.\", \" {\\n \\\"data\\\": {\\n \\\"accountGet\\\": {\\n \\\"_id\\\": \\\"...\\\",\\n \\\"email\\\": \\\"...\\\"\\n },\\n \\\"localeGet\\\": {\\n \\\"ip\\\": \\\"...\\\"\\n }\\n }\\n}\", \"If there was no authenticated user, the accountGet field would fail to resolve. In such a case the value of the data key for that field will be null, and an object will be added to the errors array instead.\", \" {\\n \\\"data\\\": {\\n \\\"accountGet\\\": null,\\n \\\"localeGet\\\": {\\n \\\"ip\\\": \\\"...\\\",\\n \\\"country\\\": \\\"...\\\"\\n }\\n },\\n \\\"errors\\\": [\\n {\\n \\\"message\\\": \\\"User (role: guest) missing scope (account)\\\",\\n \\\"path\\\": [\\\"accountGet\\\"]\\n }\\n ]\\n}\", \"Batching with a single query or mutation has some down-sides. You can not mix and match queries and mutations within the same request unless you provide an operationName, in which case you can only execute one query per request.\", \"Additionally, all variables must be passed in the same object, which can be cumbersome and hard to maintain.\", \"The second way to batch is to pass an array of queries or mutations in the request. In this way, you can execute queries and mutations and keep variables separated for each.\", \" [\\n {\\n \\\"query\\\": \\\"query GetAccount { accountGet{ email } }\\\",\\n },\\n {\\n \\\"query\\\": \\\"query GetLocale { localeGet { ip } }\\\"\\n }\\n]\", \"This allows you to execute complex actions in a single network request.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/graphql"}} \ No newline at end of file diff --git a/docs/ee43a6b6-1f0c-11ee-98fa-00155da08df7.json b/docs/4eec1f9c-4583-11ee-9922-f2ea36f81204.json similarity index 84% rename from docs/ee43a6b6-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eec1f9c-4583-11ee-9922-f2ea36f81204.json index 8861ee0..d816bb1 100644 --- a/docs/ee43a6b6-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eec1f9c-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Realtime \", \"body\": [\"Appwrite supports multiple protocols for accessing the server, including REST, GraphQL, and Realtime.\", \"Realtime allows you to listen to any events on the server-side in realtime using the subscribe method.\", \"Instead of requesting new data via HTTP, the subscription will receive new data every time it changes, any connected client receives that update within milliseconds via a WebSocket connection.\", \"This lets you build an interactive and responsive user experience by providing information from all of Appwrite's services in realtime. The example below shows subscribing to realtime events for file uploads.\", \" Web import { Client } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n// Subscribe to files channel\\nclient.subscribe('files', response => {\\n if(response.events.includes('buckets.*.files.*.create')) {\\n // Log when a new file is uploaded\\n console.log(response.payload);\\n }\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal realtime = Realtime(client);\\n\\n// Subscribe to files channel\\nfinal subscription = realtime.subscribe(['files']);\\n\\nsubscription.stream.listen((response) {\\n if(response.events.contains('buckets.*.files.*.create')) {\\n // Log when a new file is uploaded\\n print(response.payload);\\n }\\n}); Android import io.appwrite.Client\\nimport io.appwrite.services.Realtime\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nval realtime = Realtime(client)\\n\\n// Subscribe to files channel\\nlet subscription = realtime.subscribe(\\\"files\\\") {\\n if(it.events.contains(\\\"buckets.*.files.*.create\\\")) {\\n // Log when a new file is uploaded\\n print(it.payload.toString());\\n }\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet realtime = Realtime(client)\\n\\n// Subscribe to files channel\\nlet subscription = realtime.subscribe(channels: [\\\"files\\\"]) { response in\\n if (message.events!.contains(\\\"buckets.*.files.*.create\\\")) {\\n // Log when a new file is uploaded\\n print(String(describing: response))\\n }\\n} \", \"To subscribe to updates from different resources, you need to specify one or more channels. The channels offer a wide and powerful selection that will allow you to listen to all possible resources. This allows you to receive updates not only from the database, but from all the services that Appwrite offers.\", \"If you subscribe to a channel, you will receive callbacks for a variety of events related to the channel. The events attribute in the callback can be used to filter and respond to specific events in a channel.\", \"All possible events can be found here.\", \" Permissions All subscriptions are secured by the permissions system offered by Appwrite, meaning a user will only receive updates to resources they have permission to access. Using Role.any() on read permissions will allow any client to receive updates.\"]}, {\"level\": 2, \"title\": \"Authentication\", \"body\": [\"Realtime authenticates using an existing user session. If you authenticate after creating a subscription, the subscription will not receive updates for the newly authenticated user. You will need to re-create the subscription to work with the new user.\", \"More information and examples of authenticating users can be found in the dedicated authentication guide.\"]}, {\"level\": 2, \"title\": \"Examples\", \"body\": [\"The examples below will show you how you can use Realtime in various ways.\"]}, {\"level\": 3, \"title\": \"Subscribe to a Channel\", \"body\": [\"In this example we are subscribing to all updates related to our account by using the account channel. This will be triggered by any update related to the authenticated user, like updating the user's name or e-mail address.\", \" Web import { Client } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nclient.subscribe('account', response => {\\n // Callback will be executed on all account events.\\n console.log(response);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal realtime = Realtime(client);\\n\\nfinal subscription = realtime.subscribe(['account']);\\n\\nsubscription.stream.listen((response) {\\n // Callback will be executed on all account events.\\n print(response);\\n}) Android import io.appwrite.Client\\nimport io.appwrite.services.Realtime\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nval realtime = Realtime(client)\\n\\nval subscription = realtime.subscribe(\\\"account\\\") {\\n // Callback will be executed on all account events.\\n print(it.payload.toString())\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet realtime = Realtime(client)\\n\\nlet subscription = realtime.subscribe(channel: \\\"account\\\", callback: { response in\\n // Callback will be executed on all account events.\\n print(String(describing: response))\\n}) \"]}, {\"level\": 3, \"title\": \"Subscribe to Multiple Channels\", \"body\": [\"You can also listen to multiple channels at once by passing an array of channels. This will trigger the callback for any events for all channels passed.\", \"In this example we are listening to the document A and all files by subscribing to the databases.A.collections.A.documents.A and files channels.\", \" Web import { Client } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nclient.subscribe(['collections.A.documents.A', 'files'], response => {\\n // Callback will be executed on changes for documents A and all files.\\n console.log(response);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal realtime = Realtime(client);\\n\\nfinal subscription = realtime.subscribe(['databases.A.collections.A.documents.A', 'files']);\\n\\nsubscription.stream.listen((response) {\\n // Callback will be executed on changes for documents A and all files.\\n print(response);\\n}) Android import io.appwrite.Client\\nimport io.appwrite.services.Realtime\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\nval realtime = Realtime(client)\\n\\nrealtime.subscribe(\\\"databases.A.collections.A.documents.A\\\", \\\"files\\\") {\\n // Callback will be executed on changes for documents A and all files.\\n print(it.toString())\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet realtime = Realtime(client)\\n\\nrealtime.subscribe(channels: [\\\"databases.A.collections.A.documents.A\\\", \\\"files\\\"]) { response in\\n // Callback will be executed on changes for documents A and all files.\\n print(String(describing: response))\\n} \"]}, {\"level\": 3, \"title\": \"Unsubscribe\", \"body\": [\"If you no longer want to receive updates from a subscription, you can unsubscribe so that your callbacks are no longer called. Leaving old subscriptions alive and resubscribing can result in duplicate subscriptions and cause race conditions.\", \" Web import { Client } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst unsubscribe = client.subscribe('files', response => {\\n // Callback will be executed on changes for all files.\\n console.log(response);\\n});\\n\\n// Closes the subscription.\\nunsubscribe(); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal realtime = Realtime(client);\\n\\nfinal subscription = realtime.subscribe(['files']);\\n\\nsubscription.stream.listen((response) {\\n // Callback will be executed on changes for all files.\\n print(response);\\n})\\n\\n// Closes the subscription.\\nsubscription.close(); Android import io.appwrite.Client\\nimport io.appwrite.services.Realtime\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nval realtime = Realtime(client)\\n\\nval subscription = realtime.subscribe(\\\"files\\\") {\\n // Callback will be executed on changes for all files.\\n print(param.toString())\\n}\\n\\n// Closes the subscription.\\nsubscription.close() Apple \\nlet client = Client()\\nlet realtime = Realtime(client)\\n\\nlet subscription = realtime.subscribe(channel: \\\"files\\\") { response in\\n // Callback will be executed on changes for all files.\\n print(response.toString())\\n}\\n\\n// Closes the subscription.\\nsubscription.close() \"]}, {\"level\": 2, \"title\": \"Payload\", \"body\": [\"The payload from the subscription will contain following properties:\", \" Name Type Description events string[] The system events that triggered this update. channels string[] An array of channels that can receive this message. timestamp string The ISO 8601 timestamp in UTC timezone from the server to ensure consistency across all client platforms and real-time technologies. payload object Payload contains the data equal to the response model. \", \"If you subscribe to the documents channel and a document the user is allowed to read is updated, you will receive an object containing information about the event and the updated document.\", \"The response will look like this:\", \" {\\n \\\"events\\\": [\\n \\\"databases.default.collections.sample.documents.63c98b9baea0938e1206.update\\\",\\n \\\"databases.*.collections.*.documents.*.update\\\",\\n \\\"databases.default.collections.*.documents.63c98b9baea0938e1206.update\\\",\\n \\\"databases.*.collections.*.documents.63c98b9baea0938e1206.update\\\",\\n \\\"databases.*.collections.sample.documents.63c98b9baea0938e1206.update\\\",\\n \\\"databases.default.collections.sample.documents.*.update\\\",\\n \\\"databases.*.collections.sample.documents.*.update\\\",\\n \\\"databases.default.collections.*.documents.*.update\\\",\\n \\\"databases.default.collections.sample.documents.63c98b9baea0938e1206\\\",\\n \\\"databases.*.collections.*.documents.*\\\",\\n \\\"databases.default.collections.*.documents.63c98b9baea0938e1206\\\",\\n \\\"databases.*.collections.*.documents.63c98b9baea0938e1206\\\",\\n \\\"databases.*.collections.sample.documents.63c98b9baea0938e1206\\\",\\n \\\"databases.default.collections.sample.documents.*\\\",\\n \\\"databases.*.collections.sample.documents.*\\\",\\n \\\"databases.default.collections.*.documents.*\\\",\\n \\\"databases.default.collections.sample\\\",\\n \\\"databases.*.collections.*\\\",\\n \\\"databases.default.collections.*\\\",\\n \\\"databases.*.collections.sample\\\",\\n \\\"databases.default\\\",\\n \\\"databases.*\\\"\\n ],\\n \\\"channels\\\": [\\n \\\"documents\\\",\\n \\\"databases.default.collections.sample.documents\\\",\\n \\\"databases.default.collections.sample.documents.63c98b9baea0938e1206\\\"\\n ],\\n \\\"timestamp\\\": \\\"2023-01-19 18:30:04.051\\\",\\n \\\"payload\\\": {\\n \\\"ip\\\": \\\"127.0.0.1\\\",\\n \\\"stringArray\\\": [\\n \\\"sss\\\"\\n ],\\n \\\"email\\\": \\\"joe@example.com\\\",\\n \\\"stringRequired\\\": \\\"req\\\",\\n \\\"float\\\": 3.3,\\n \\\"boolean\\\": false,\\n \\\"integer\\\": 3,\\n \\\"enum\\\": \\\"apple\\\",\\n \\\"stringDefault\\\": \\\"default\\\",\\n \\\"datetime\\\": \\\"2023-01-19T10:27:09.428+00:00\\\",\\n \\\"url\\\": \\\"https://appwrite.io\\\",\\n \\\"$id\\\": \\\"63c98b9baea0938e1206\\\",\\n \\\"$createdAt\\\": \\\"2023-01-19T18:27:39.715+00:00\\\",\\n \\\"$updatedAt\\\": \\\"2023-01-19T18:30:04.040+00:00\\\",\\n \\\"$permissions\\\": [],\\n \\\"$collectionId\\\": \\\"sample\\\",\\n \\\"$databaseId\\\": \\\"default\\\"\\n }\\n}\"]}, {\"level\": 2, \"title\": \"Channels\", \"body\": [\"A list of all channels available you can subscribe to:\", \" Channel Description account All account related events (session create, name update...) databases.[ID].collections.[ID].documents Any create/update/delete events to any document in a collection documents Any create/update/delete events to any document databases.[ID].collections.[ID].documents.[ID] Any update/delete events to a given document files Any create/update/delete events to any file buckets.[ID].files.[ID] Any update/delete events to a given file of the given bucket buckets.[ID].files Any update/delete events to any file of the given bucket teams Any create/update/delete events to a any team teams.[ID] Any update/delete events to a given team memberships Any create/update/delete events to a any membership memberships.[ID] Any update/delete events to a given membership executions Any update to executions executions.[ID] Any update to a given execution functions.[ID] Any execution event to a given function \"]}, {\"level\": 2, \"title\": \"Custom Endpoint\", \"body\": [\"The SDK will guess the endpoint of the Realtime API when setting the endpoint of your Appwrite instance. If you are running Appwrite with a custom proxy and changed the route of the Realtime API, you can call the setEndpointRealtime method on the Client SDK and set your new endpoint value.\", \"By default the endpoint is wss://cloud.appwrite.io/v1/realtime.\", \" Web import { Client } from \\\"appwrite\\\";\\nconst client = new Client();\\n\\nclient.setEndpointRealtime('cloud.appwrite.io'); Flutter final client = Client();\\nclient.setEndpointRealtime('cloud.appwrite.io'); Android val client = Client(context)\\nclient.setEndpointRealtime(\\\"cloud.appwrite.io\\\") Apple let client = Client()\\nclient.setEndpointRealtime(\\\"cloud.appwrite.io\\\") \"]}, {\"level\": 2, \"title\": \"Known Limitations\", \"body\": []}, {\"level\": 3, \"title\": \"Rapid Subscriptions Changes\", \"body\": [\"The SDK creates a single WebSocket connection for all subscribed channels. Each time a channel is added or unsubscribed - the SDK currently creates a completely new connection and terminates the old one. Therefore, subscriptions to channels should always be done in conjunction with state management so as not to be unnecessarily built up several times by multiple components' life cycles.\"]}]", "metadata": {"source": "https://appwrite.io/docs/realtime"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Realtime \", \"body\": [\"Appwrite supports multiple protocols for accessing the server, including REST, GraphQL, and Realtime.\", \"Realtime allows you to listen to any events on the server-side in realtime using the subscribe method.\", \"Instead of requesting new data via HTTP, the subscription will receive new data every time it changes, any connected client receives that update within milliseconds via a WebSocket connection.\", \"This lets you build an interactive and responsive user experience by providing information from all of Appwrite's services in realtime. The example below shows subscribing to realtime events for file uploads.\", \" Web import { Client } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n// Subscribe to files channel\\nclient.subscribe('files', response => {\\n if(response.events.includes('buckets.*.files.*.create')) {\\n // Log when a new file is uploaded\\n console.log(response.payload);\\n }\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal realtime = Realtime(client);\\n\\n// Subscribe to files channel\\nfinal subscription = realtime.subscribe(['files']);\\n\\nsubscription.stream.listen((response) {\\n if(response.events.contains('buckets.*.files.*.create')) {\\n // Log when a new file is uploaded\\n print(response.payload);\\n }\\n}); Android import io.appwrite.Client\\nimport io.appwrite.services.Realtime\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nval realtime = Realtime(client)\\n\\n// Subscribe to files channel\\nlet subscription = realtime.subscribe(\\\"files\\\") {\\n if(it.events.contains(\\\"buckets.*.files.*.create\\\")) {\\n // Log when a new file is uploaded\\n print(it.payload.toString());\\n }\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet realtime = Realtime(client)\\n\\n// Subscribe to files channel\\nlet subscription = realtime.subscribe(channels: [\\\"files\\\"]) { response in\\n if (message.events!.contains(\\\"buckets.*.files.*.create\\\")) {\\n // Log when a new file is uploaded\\n print(String(describing: response))\\n }\\n} \", \"To subscribe to updates from different resources, you need to specify one or more channels. The channels offer a wide and powerful selection that will allow you to listen to all possible resources. This allows you to receive updates not only from the database, but from all the services that Appwrite offers.\", \"If you subscribe to a channel, you will receive callbacks for a variety of events related to the channel. The events attribute in the callback can be used to filter and respond to specific events in a channel.\", \"All possible events can be found here.\", \" Permissions All subscriptions are secured by the permissions system offered by Appwrite, meaning a user will only receive updates to resources they have permission to access. Using Role.any() on read permissions will allow any client to receive updates.\"]}, {\"level\": 2, \"title\": \"Authentication\", \"body\": [\"Realtime authenticates using an existing user session. If you authenticate after creating a subscription, the subscription will not receive updates for the newly authenticated user. You will need to re-create the subscription to work with the new user.\", \"More information and examples of authenticating users can be found in the dedicated authentication guide.\"]}, {\"level\": 2, \"title\": \"Examples\", \"body\": [\"The examples below will show you how you can use Realtime in various ways.\"]}, {\"level\": 3, \"title\": \"Subscribe to a Channel\", \"body\": [\"In this example we are subscribing to all updates related to our account by using the account channel. This will be triggered by any update related to the authenticated user, like updating the user's name or e-mail address.\", \" Web import { Client } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nclient.subscribe('account', response => {\\n // Callback will be executed on all account events.\\n console.log(response);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal realtime = Realtime(client);\\n\\nfinal subscription = realtime.subscribe(['account']);\\n\\nsubscription.stream.listen((response) {\\n // Callback will be executed on all account events.\\n print(response);\\n}) Android import io.appwrite.Client\\nimport io.appwrite.services.Realtime\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nval realtime = Realtime(client)\\n\\nval subscription = realtime.subscribe(\\\"account\\\") {\\n // Callback will be executed on all account events.\\n print(it.payload.toString())\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet realtime = Realtime(client)\\n\\nlet subscription = realtime.subscribe(channel: \\\"account\\\", callback: { response in\\n // Callback will be executed on all account events.\\n print(String(describing: response))\\n}) \"]}, {\"level\": 3, \"title\": \"Subscribe to Multiple Channels\", \"body\": [\"You can also listen to multiple channels at once by passing an array of channels. This will trigger the callback for any events for all channels passed.\", \"In this example we are listening to the document A and all files by subscribing to the databases.A.collections.A.documents.A and files channels.\", \" Web import { Client } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nclient.subscribe(['collections.A.documents.A', 'files'], response => {\\n // Callback will be executed on changes for documents A and all files.\\n console.log(response);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal realtime = Realtime(client);\\n\\nfinal subscription = realtime.subscribe(['databases.A.collections.A.documents.A', 'files']);\\n\\nsubscription.stream.listen((response) {\\n // Callback will be executed on changes for documents A and all files.\\n print(response);\\n}) Android import io.appwrite.Client\\nimport io.appwrite.services.Realtime\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\nval realtime = Realtime(client)\\n\\nrealtime.subscribe(\\\"databases.A.collections.A.documents.A\\\", \\\"files\\\") {\\n // Callback will be executed on changes for documents A and all files.\\n print(it.toString())\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet realtime = Realtime(client)\\n\\nrealtime.subscribe(channels: [\\\"databases.A.collections.A.documents.A\\\", \\\"files\\\"]) { response in\\n // Callback will be executed on changes for documents A and all files.\\n print(String(describing: response))\\n} \"]}, {\"level\": 3, \"title\": \"Unsubscribe\", \"body\": [\"If you no longer want to receive updates from a subscription, you can unsubscribe so that your callbacks are no longer called. Leaving old subscriptions alive and resubscribing can result in duplicate subscriptions and cause race conditions.\", \" Web import { Client } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst unsubscribe = client.subscribe('files', response => {\\n // Callback will be executed on changes for all files.\\n console.log(response);\\n});\\n\\n// Closes the subscription.\\nunsubscribe(); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal realtime = Realtime(client);\\n\\nfinal subscription = realtime.subscribe(['files']);\\n\\nsubscription.stream.listen((response) {\\n // Callback will be executed on changes for all files.\\n print(response);\\n})\\n\\n// Closes the subscription.\\nsubscription.close(); Android import io.appwrite.Client\\nimport io.appwrite.services.Realtime\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nval realtime = Realtime(client)\\n\\nval subscription = realtime.subscribe(\\\"files\\\") {\\n // Callback will be executed on changes for all files.\\n print(param.toString())\\n}\\n\\n// Closes the subscription.\\nsubscription.close() Apple \\nlet client = Client()\\nlet realtime = Realtime(client)\\n\\nlet subscription = realtime.subscribe(channel: \\\"files\\\") { response in\\n // Callback will be executed on changes for all files.\\n print(response.toString())\\n}\\n\\n// Closes the subscription.\\nsubscription.close() \"]}, {\"level\": 2, \"title\": \"Payload\", \"body\": [\"The payload from the subscription will contain following properties:\", \" Name Type Description events string[] The system events that triggered this update. channels string[] An array of channels that can receive this message. timestamp string The ISO 8601 timestamp in UTC timezone from the server to ensure consistency across all client platforms and real-time technologies. payload object Payload contains the data equal to the response model. \", \"If you subscribe to the documents channel and a document the user is allowed to read is updated, you will receive an object containing information about the event and the updated document.\", \"The response will look like this:\", \" {\\n \\\"events\\\": [\\n \\\"databases.default.collections.sample.documents.63c98b9baea0938e1206.update\\\",\\n \\\"databases.*.collections.*.documents.*.update\\\",\\n \\\"databases.default.collections.*.documents.63c98b9baea0938e1206.update\\\",\\n \\\"databases.*.collections.*.documents.63c98b9baea0938e1206.update\\\",\\n \\\"databases.*.collections.sample.documents.63c98b9baea0938e1206.update\\\",\\n \\\"databases.default.collections.sample.documents.*.update\\\",\\n \\\"databases.*.collections.sample.documents.*.update\\\",\\n \\\"databases.default.collections.*.documents.*.update\\\",\\n \\\"databases.default.collections.sample.documents.63c98b9baea0938e1206\\\",\\n \\\"databases.*.collections.*.documents.*\\\",\\n \\\"databases.default.collections.*.documents.63c98b9baea0938e1206\\\",\\n \\\"databases.*.collections.*.documents.63c98b9baea0938e1206\\\",\\n \\\"databases.*.collections.sample.documents.63c98b9baea0938e1206\\\",\\n \\\"databases.default.collections.sample.documents.*\\\",\\n \\\"databases.*.collections.sample.documents.*\\\",\\n \\\"databases.default.collections.*.documents.*\\\",\\n \\\"databases.default.collections.sample\\\",\\n \\\"databases.*.collections.*\\\",\\n \\\"databases.default.collections.*\\\",\\n \\\"databases.*.collections.sample\\\",\\n \\\"databases.default\\\",\\n \\\"databases.*\\\"\\n ],\\n \\\"channels\\\": [\\n \\\"documents\\\",\\n \\\"databases.default.collections.sample.documents\\\",\\n \\\"databases.default.collections.sample.documents.63c98b9baea0938e1206\\\"\\n ],\\n \\\"timestamp\\\": \\\"2023-01-19 18:30:04.051\\\",\\n \\\"payload\\\": {\\n \\\"ip\\\": \\\"127.0.0.1\\\",\\n \\\"stringArray\\\": [\\n \\\"sss\\\"\\n ],\\n \\\"email\\\": \\\"joe@example.com\\\",\\n \\\"stringRequired\\\": \\\"req\\\",\\n \\\"float\\\": 3.3,\\n \\\"boolean\\\": false,\\n \\\"integer\\\": 3,\\n \\\"enum\\\": \\\"apple\\\",\\n \\\"stringDefault\\\": \\\"default\\\",\\n \\\"datetime\\\": \\\"2023-01-19T10:27:09.428+00:00\\\",\\n \\\"url\\\": \\\"https://appwrite.io\\\",\\n \\\"$id\\\": \\\"63c98b9baea0938e1206\\\",\\n \\\"$createdAt\\\": \\\"2023-01-19T18:27:39.715+00:00\\\",\\n \\\"$updatedAt\\\": \\\"2023-01-19T18:30:04.040+00:00\\\",\\n \\\"$permissions\\\": [],\\n \\\"$collectionId\\\": \\\"sample\\\",\\n \\\"$databaseId\\\": \\\"default\\\"\\n }\\n}\"]}, {\"level\": 2, \"title\": \"Channels\", \"body\": [\"A list of all channels available you can subscribe to. IDs cannot be wildcards.\", \" Channel Description account All account related events (session create, name update...) databases.[ID].collections.[ID].documents Any create/update/delete events to any document in a collection documents Any create/update/delete events to any document databases.[ID].collections.[ID].documents.[ID] Any update/delete events to a given document files Any create/update/delete events to any file buckets.[ID].files.[ID] Any update/delete events to a given file of the given bucket buckets.[ID].files Any update/delete events to any file of the given bucket teams Any create/update/delete events to a any team teams.[ID] Any update/delete events to a given team memberships Any create/update/delete events to a any membership memberships.[ID] Any update/delete events to a given membership executions Any update to executions executions.[ID] Any update to a given execution functions.[ID] Any execution event to a given function \"]}, {\"level\": 2, \"title\": \"Custom Endpoint\", \"body\": [\"The SDK will guess the endpoint of the Realtime API when setting the endpoint of your Appwrite instance. If you are running Appwrite with a custom proxy and changed the route of the Realtime API, you can call the setEndpointRealtime method on the Client SDK and set your new endpoint value.\", \"By default the endpoint is wss://cloud.appwrite.io/v1/realtime.\", \" Web import { Client } from \\\"appwrite\\\";\\nconst client = new Client();\\n\\nclient.setEndpointRealtime('cloud.appwrite.io'); Flutter final client = Client();\\nclient.setEndpointRealtime('cloud.appwrite.io'); Android val client = Client(context)\\nclient.setEndpointRealtime(\\\"cloud.appwrite.io\\\") Apple let client = Client()\\nclient.setEndpointRealtime(\\\"cloud.appwrite.io\\\") \"]}, {\"level\": 2, \"title\": \"Known Limitations\", \"body\": []}, {\"level\": 3, \"title\": \"Rapid Subscriptions Changes\", \"body\": [\"The SDK creates a single WebSocket connection for all subscribed channels. Each time a channel is added or unsubscribed - the SDK currently creates a completely new connection and terminates the old one. Therefore, subscriptions to channels should always be done in conjunction with state management so as not to be unnecessarily built up several times by multiple components' life cycles.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/realtime"}} \ No newline at end of file diff --git a/docs/4eec3324-4583-11ee-9922-f2ea36f81204.json b/docs/4eec3324-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..752dba1 --- /dev/null +++ b/docs/4eec3324-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/account"}} \ No newline at end of file diff --git a/docs/4eec3932-4583-11ee-9922-f2ea36f81204.json b/docs/4eec3932-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..9b9f1f8 --- /dev/null +++ b/docs/4eec3932-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/users"}} \ No newline at end of file diff --git a/docs/4eec3e96-4583-11ee-9922-f2ea36f81204.json b/docs/4eec3e96-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..6d37e2a --- /dev/null +++ b/docs/4eec3e96-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/teams"}} \ No newline at end of file diff --git a/docs/4eec43a0-4583-11ee-9922-f2ea36f81204.json b/docs/4eec43a0-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..d072880 --- /dev/null +++ b/docs/4eec43a0-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/databases"}} \ No newline at end of file diff --git a/docs/4eec48b4-4583-11ee-9922-f2ea36f81204.json b/docs/4eec48b4-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..fcd439b --- /dev/null +++ b/docs/4eec48b4-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/storage"}} \ No newline at end of file diff --git a/docs/4eec4eae-4583-11ee-9922-f2ea36f81204.json b/docs/4eec4eae-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..3fcf8f9 --- /dev/null +++ b/docs/4eec4eae-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/functions"}} \ No newline at end of file diff --git a/docs/4eec54b2-4583-11ee-9922-f2ea36f81204.json b/docs/4eec54b2-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..200b2f0 --- /dev/null +++ b/docs/4eec54b2-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/locale"}} \ No newline at end of file diff --git a/docs/4eec5a5c-4583-11ee-9922-f2ea36f81204.json b/docs/4eec5a5c-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..a3a9e57 --- /dev/null +++ b/docs/4eec5a5c-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/avatars"}} \ No newline at end of file diff --git a/docs/8c288a5e-f62c-11ed-8355-0242c0a89002.json b/docs/4eec604c-4583-11ee-9922-f2ea36f81204.json similarity index 98% rename from docs/8c288a5e-f62c-11ed-8355-0242c0a89002.json rename to docs/4eec604c-4583-11ee-9922-f2ea36f81204.json index df823bc..9c76951 100644 --- a/docs/8c288a5e-f62c-11ed-8355-0242c0a89002.json +++ b/docs/4eec604c-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Databases \", \"body\": [\" The Databases Service allows you to store your application and users' data and fetch it using different supported queries. You can organize your data into a three-level hierarchy, which are databases, collections, and documents. Each database is a group of collections, each collection is a group of documents that share the same schema, and each document contains a set of data.\", \" In addition, the Databases Service provides built-in validation to check the integrity of your incoming data, custom indexing for query performance, relationships to link data, and a flexible permissions mechanism to easily segment data between different users, teams, and roles. You can also use the Appwrite Realtime API to subscribe to live changes in your database.\"]}, {\"level\": 2, \"title\": \"Create Your Databases\", \"body\": [\" Appwrite's Databases Service allows you to create multiple databases. Each database can contain many collections and can be backed by a different database adaptor in future versions.\", \" You can create your database by adding it to your Appwrite project's dashboard. Access the Databases Service settings from your project's left-hand navigation panel. To create a new database, click the Create Database button. Name your new database, and optionally provide a custom database ID.\", \" You can also create databases with the Appwrite CLI or the Appwrite Server SDKs.\"]}, {\"level\": 2, \"title\": \"Create Your Collections\", \"body\": [\" Appwrite uses collections as containers of documents. The terms collections and documents are used because the Appwrite JSON REST API resembles the API of a traditional NoSQL database. That said, internally, Appwrite will support both SQL and NoSQL database adapters like MariaDB, MySQL, or MongoDB. When working with an SQL adapter, Appwrite will treat your collections as tables and documents as rows on native SQL tables.\", \" To add a collection to a database, first navigate to the desired database's dashboard. In the database's dashboard, click the Add Collection button and choose your collection's name. For convenience, you can also set a custom ID for your collection instead of an auto-generated ID.\", \"You can manage your collections programmatically using the Appwrite CLI or one of Appwrite Server SDKs. You can manage documents with both the Server and Client SDKs.\"]}, {\"level\": 3, \"title\": \"Permissions\", \"body\": [\" Appwrite provides permissions to restrict access to documents at two levels, document and collection level. When a user has the appropriate type of access permissions granted at either the document or the collection level, they will be able to access or change the document. If the permission field is left empty, Client SDKs cannot access the document.\"]}, {\"level\": 4, \"title\": \"Document Level Permissions\", \"body\": [\"Document level permissions grant access to individual documents. Document level permissions are only applied if Document Security is enabled in the settings of your collection.\"]}, {\"level\": 4, \"title\": \"Collection Level Permissions\", \"body\": [\"Collection level permissions apply to every document in the collection.\"]}, {\"level\": 2, \"title\": \"Create Attributes\", \"body\": [\" Once you choose your permission model, navigate to your collection's Attributes tab. Attributes are used to define the structure of your documents and help the Appwrite API validate your users' input. Add your first attribute by clicking the Add Attribute button. You can choose between the following types:\", \" Attribute Description string String attribute. integer Integer attribute. float Float attribute. boolean Boolean attribute. enum Enum attribute. ip IP address attribute for IPv4 and IPv6. email Email address attribute. url URL attribute. relationship Relationship attribute relates one collection to another. Learn more about relationships. \", \" If an attribute must be populated in all documents, set it as required. If not, you may optionally set a default value. Additionally, decide if the attribute should be a single value or an array of values.\", \" When adding or removing attributes, your requests are processed in the background, indicated by the attribute's status. Depending on your collection's size and other factors, this could take anywhere from a few seconds to a few minutes to complete. You are able to create a document while your attributes are still being processed, however you are not able to use the attributes on the documents until they are available.\"]}, {\"level\": 3, \"title\": \"Create Documents\", \"body\": [\" Navigate to the Documents tab of your collection and click the Add Document button, or add a document programmatically:\", \" Web import { Client, Databases, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n\\nconst promise = databases.createDocument(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n ID.unique(),\\n {}\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n try {\\n final document = databases.createDocument(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n documentId: ID.unique(),\\n data: {}\\n );\\n } on AppwriteException catch(e) {\\n print(e);\\n }\\n} Android import io.appwrite.Client\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val databases = Databases(client)\\n\\n try {\\n val document = databases.createDocument(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n documentId = ID.unique(),\\n data = mapOf(\\\"a\\\" to \\\"b\\\"),\\n )\\n } catch (e: Exception) {\\n Log.e(\\\"Appwrite\\\", \\\"Error: \\\" + e.message)\\n }\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n do {\\n let document = try await databases.createDocument(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n documentId: ID.unique(),\\n data: [:]\\n )\\n } catch {\\n print(error.localizedDescription)\\n }\\n} GraphQL mutation {\\n databasesCreateDocument(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n documentId: \\\"[DOCUMENT_ID]\\\",\\n data: \\\"{}\\\"\\n ) {\\n _id\\n _collectionId\\n _databaseId\\n _createdAt\\n _updatedAt\\n _permissions\\n data\\n }\\n} \"]}, {\"level\": 2, \"title\": \"Indexes\", \"body\": [\" Databases use indexes to quickly locate data without having to search through every document for matches. To ensure the best performance, Appwrite recommends an index for every attribute queried. You can create an index by navigating to your collection's Indexes tab or by using your favorite Server SDK. If you plan to query multiple attributes in a single query, creating an index with all queried attributes will yield optimal performance.\", \" The following indexes are currently supported:\", \" Type Description key Plain Index to allow queries. unique Unique Index to disallow duplicates. fulltext For searching within string attributes. Required for the search query method. \"]}]", "metadata": {"source": "https://appwrite.io/docs/databases"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Databases \", \"body\": [\" The Databases Service allows you to store your application and users' data and fetch it using different supported queries. You can organize your data into a three-level hierarchy, which are databases, collections, and documents. Each database is a group of collections, each collection is a group of documents that share the same schema, and each document contains a set of data.\", \" In addition, the Databases Service provides built-in validation to check the integrity of your incoming data, custom indexing for query performance, relationships to link data, and a flexible permissions mechanism to easily segment data between different users, teams, and roles. You can also use the Appwrite Realtime API to subscribe to live changes in your database.\"]}, {\"level\": 2, \"title\": \"Create Your Databases\", \"body\": [\" Appwrite's Databases Service allows you to create multiple databases. Each database can contain many collections and can be backed by a different database adaptor in future versions.\", \" You can create your database by adding it to your Appwrite project's dashboard. Access the Databases Service settings from your project's left-hand navigation panel. To create a new database, click the Create Database button. Name your new database, and optionally provide a custom database ID.\", \" You can also create databases with the Appwrite CLI or the Appwrite Server SDKs.\"]}, {\"level\": 2, \"title\": \"Create Your Collections\", \"body\": [\" Appwrite uses collections as containers of documents. The terms collections and documents are used because the Appwrite JSON REST API resembles the API of a traditional NoSQL database. That said, internally, Appwrite will support both SQL and NoSQL database adapters like MariaDB, MySQL, or MongoDB. When working with an SQL adapter, Appwrite will treat your collections as tables and documents as rows on native SQL tables.\", \" To add a collection to a database, first navigate to the desired database's dashboard. In the database's dashboard, click the Add Collection button and choose your collection's name. For convenience, you can also set a custom ID for your collection instead of an auto-generated ID.\", \"You can manage your collections programmatically using the Appwrite CLI or one of Appwrite Server SDKs. You can manage documents with both the Server and Client SDKs.\"]}, {\"level\": 3, \"title\": \"Permissions\", \"body\": [\" Appwrite provides permissions to restrict access to documents at two levels, document and collection level. When a user has the appropriate type of access permissions granted at either the document or the collection level, they will be able to access or change the document. If the permission field is left empty, Client SDKs cannot access the document.\"]}, {\"level\": 4, \"title\": \"Document Level Permissions\", \"body\": [\"Document level permissions grant access to individual documents. Document level permissions are only applied if Document Security is enabled in the settings of your collection.\"]}, {\"level\": 4, \"title\": \"Collection Level Permissions\", \"body\": [\"Collection level permissions apply to every document in the collection.\"]}, {\"level\": 2, \"title\": \"Create Attributes\", \"body\": [\" Once you choose your permission model, navigate to your collection's Attributes tab. Attributes are used to define the structure of your documents and help the Appwrite API validate your users' input. Add your first attribute by clicking the Add Attribute button. You can choose between the following types:\", \" Attribute Description string String attribute. integer Integer attribute. float Float attribute. boolean Boolean attribute. enum Enum attribute. ip IP address attribute for IPv4 and IPv6. email Email address attribute. url URL attribute. relationship Relationship attribute relates one collection to another. Learn more about relationships. \", \" If an attribute must be populated in all documents, set it as required. If not, you may optionally set a default value. Additionally, decide if the attribute should be a single value or an array of values.\", \" When adding or removing attributes, your requests are processed in the background, indicated by the attribute's status. Depending on your collection's size and other factors, this could take anywhere from a few seconds to a few minutes to complete. You are able to create a document while your attributes are still being processed, however you are not able to use the attributes on the documents until they are available.\"]}, {\"level\": 3, \"title\": \"Create Documents\", \"body\": [\" Navigate to the Documents tab of your collection and click the Add Document button, or add a document programmatically:\", \" Web import { Client, Databases, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n\\nconst promise = databases.createDocument(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n ID.unique(),\\n {}\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n try {\\n final document = databases.createDocument(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n documentId: ID.unique(),\\n data: {}\\n );\\n } on AppwriteException catch(e) {\\n print(e);\\n }\\n} Android import io.appwrite.Client\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val databases = Databases(client)\\n\\n try {\\n val document = databases.createDocument(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n documentId = ID.unique(),\\n data = mapOf(\\\"a\\\" to \\\"b\\\"),\\n )\\n } catch (e: Exception) {\\n Log.e(\\\"Appwrite\\\", \\\"Error: \\\" + e.message)\\n }\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n do {\\n let document = try await databases.createDocument(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n documentId: ID.unique(),\\n data: [:]\\n )\\n } catch {\\n print(error.localizedDescription)\\n }\\n} GraphQL mutation {\\n databasesCreateDocument(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n documentId: \\\"[DOCUMENT_ID]\\\",\\n data: \\\"{}\\\"\\n ) {\\n _id\\n _collectionId\\n _databaseId\\n _createdAt\\n _updatedAt\\n _permissions\\n data\\n }\\n} \"]}, {\"level\": 2, \"title\": \"Indexes\", \"body\": [\" Databases use indexes to quickly locate data without having to search through every document for matches. To ensure the best performance, Appwrite recommends an index for every attribute queried. You can create an index by navigating to your collection's Indexes tab or by using your favorite Server SDK. If you plan to query multiple attributes in a single query, creating an index with all queried attributes will yield optimal performance.\", \" The following indexes are currently supported:\", \" Type Description key Plain Index to allow queries. unique Unique Index to disallow duplicates. fulltext For searching within string attributes. Required for the search query method. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/databases"}} \ No newline at end of file diff --git a/docs/ee43bdb8-1f0c-11ee-98fa-00155da08df7.json b/docs/4eec6d12-4583-11ee-9922-f2ea36f81204.json similarity index 98% rename from docs/ee43bdb8-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eec6d12-4583-11ee-9922-f2ea36f81204.json index 8205af3..7ec17e7 100644 --- a/docs/ee43bdb8-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eec6d12-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Queries \", \"body\": [\"Many list endpoints in Appwrite allow you to filter, sort, and paginate results using queries. Appwrite provides a common set of syntax to build queries.\"]}, {\"level\": 2, \"title\": \"Query Compatibility\", \"body\": [\"Each list endpoint supports different query operations. You can find the supported query methods and attributes in the References section of the Appwrite documentation.\"]}, {\"level\": 2, \"title\": \"Query Class\", \"body\": [\"Appwrite SDKs provide a Query class to help you build queries. The Query class has a method for each type of supported query.\", \" Query Method SDK Method Example Description Select Query.select([\\\"name\\\", \\\"title\\\"]) Select which attributes should be returned from a document. Equal Query.equal(\\\"title\\\", [\\\"Iron Man\\\"]) Returns document if attribute is equal to any value in the provided array. Not Equal Query.notEqual(\\\"title\\\", [\\\"Iron Man\\\"]) Returns document if attribute is not equal to any value in the provided array. Less Than Query.lessThan(\\\"score\\\", 10) Returns document if attribute is less than the provided value. Less Than or Equal Query.lessThanEqual(\\\"score\\\", 10) Returns document if attribute is less than or equal to the provided value. Greater Than Query.greaterThan(\\\"score\\\", 10) Returns document if attribute is greater than the provided value. Greater Than or Equal Query.greaterThanEqual(\\\"score\\\", 10) Returns document if attribute is greater than or equal to the provided value. Between Query.between(\\\"price\\\", 5, 10) Returns document if attribute value falls between the two values. The boundary values are inclusive and can be strings or numbers. Is Null Query.isNull(\\\"name\\\") Returns documents where attribute value is null. Is Not Null Query.isNotNull(\\\"name\\\") Returns documents where attribute value is not null. Starts With Query.startsWith(\\\"name\\\", \\\"Once upon a time\\\") Returns documents if a string attributes starts with a substring. Ends With Query.endsWith(\\\"name\\\", \\\"happily ever after.\\\") Returns documents if a string attributes ends with a substring. Search Query.search(\\\"text\\\", \\\"key words\\\") Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. Order Descending Query.orderDesc(\\\"attribute\\\") Orders results in descending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. Order Ascending Query.orderAsc(\\\"attribute\\\") Orders results in ascending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. Limit Query.limit(25) Limits the number of results returned by the query. Used for pagination. If the limit query is not used, the limit defaults to 25 results. Offset Query.offset(0) Offset the results returned by skipping some of the results. Used for pagination. Cursor After Query.cursorAfter(\\\"62a7...f620\\\") Places the cursor after the specified resource ID. Used for pagination. Cursor Before Query.cursorBefore(\\\"62a7...a600\\\") Places the cursor before the specified resource ID. Used for pagination. \"]}, {\"level\": 2, \"title\": \"Building Queries\", \"body\": [\" Queries are passed to an endpoint through the queries parameter as an array of query strings, which can be generated using the Query class.\", \"Each query method is logically separated via AND operations. For OR operation, pass multiple values into the query method separated by commas. For example Query.equal('title', ['Avatar', 'Lord of the Rings']) will fetch the movies \\\"Avatar\\\" or \\\"Lord of the Rings\\\".\", \" Web import { Client, Databases, Query } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n\\ndatabases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.equal('title', ['Avatar', 'Lord of the Rings']),\\n Query.greaterThan('year', 1999)\\n ]\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n try {\\n final documents = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.equal('title', ['Avatar', 'Lord of the Rings']),\\n Query.greaterThan('year', 1999)\\n ]\\n );\\n } on AppwriteException catch(e) {\\n print(e);\\n }\\n} Android import io.appwrite.Client\\nimport io.appwrite.Query\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n val databases = Databases(client)\\n\\n try {\\n val documents = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = listOf(\\n Query.equal(\\\"title\\\", listOf(\\\"Avatar\\\", \\\"Lord of the Rings\\\")),\\n Query.greaterThan(\\\"year\\\", 1999)\\n )\\n )\\n } catch (e: AppwriteException) {\\n Log.e(\\\"Appwrite\\\", e.message)\\n }\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n do {\\n let documents = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.equal(\\\"title\\\", [\\\"Avatar\\\", \\\"Lord of the Rings\\\"]),\\n Query.greaterThan(\\\"year\\\", 1999)\\n ]\\n )\\n } catch {\\n print(error.localizedDescription)\\n }\\n} GraphQL query {\\n databasesListDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\"\\n queries: [\\\"equal(\\\\\\\"title\\\\\\\", [\\\\\\\"Avatar\\\\\\\", \\\\\\\"Lord of the Rings\\\\\\\"])\\\", \\\"greaterThan(\\\\\\\"year\\\\\\\", 1999)\\\"]\\n ) {\\n total\\n documents {\\n _id\\n data\\n }\\n }\\n} \"]}]", "metadata": {"source": "https://appwrite.io/docs/databases-queries"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Queries \", \"body\": [\"Many list endpoints in Appwrite allow you to filter, sort, and paginate results using queries. Appwrite provides a common set of syntax to build queries.\"]}, {\"level\": 2, \"title\": \"Query Compatibility\", \"body\": [\"Each list endpoint supports different query operations. You can find the supported query methods and attributes in the References section of the Appwrite documentation.\"]}, {\"level\": 2, \"title\": \"Query Class\", \"body\": [\"Appwrite SDKs provide a Query class to help you build queries. The Query class has a method for each type of supported query.\", \" Query Method SDK Method Example Description Select Query.select([\\\"name\\\", \\\"title\\\"]) Select which attributes should be returned from a document. Equal Query.equal(\\\"title\\\", [\\\"Iron Man\\\"]) Returns document if attribute is equal to any value in the provided array. Not Equal Query.notEqual(\\\"title\\\", [\\\"Iron Man\\\"]) Returns document if attribute is not equal to any value in the provided array. Less Than Query.lessThan(\\\"score\\\", 10) Returns document if attribute is less than the provided value. Less Than or Equal Query.lessThanEqual(\\\"score\\\", 10) Returns document if attribute is less than or equal to the provided value. Greater Than Query.greaterThan(\\\"score\\\", 10) Returns document if attribute is greater than the provided value. Greater Than or Equal Query.greaterThanEqual(\\\"score\\\", 10) Returns document if attribute is greater than or equal to the provided value. Between Query.between(\\\"price\\\", 5, 10) Returns document if attribute value falls between the two values. The boundary values are inclusive and can be strings or numbers. Is Null Query.isNull(\\\"name\\\") Returns documents where attribute value is null. Is Not Null Query.isNotNull(\\\"name\\\") Returns documents where attribute value is not null. Starts With Query.startsWith(\\\"name\\\", \\\"Once upon a time\\\") Returns documents if a string attributes starts with a substring. Ends With Query.endsWith(\\\"name\\\", \\\"happily ever after.\\\") Returns documents if a string attributes ends with a substring. Search Query.search(\\\"text\\\", \\\"key words\\\") Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. Order Descending Query.orderDesc(\\\"attribute\\\") Orders results in descending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. Order Ascending Query.orderAsc(\\\"attribute\\\") Orders results in ascending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. Limit Query.limit(25) Limits the number of results returned by the query. Used for pagination. If the limit query is not used, the limit defaults to 25 results. Offset Query.offset(0) Offset the results returned by skipping some of the results. Used for pagination. Cursor After Query.cursorAfter(\\\"62a7...f620\\\") Places the cursor after the specified resource ID. Used for pagination. Cursor Before Query.cursorBefore(\\\"62a7...a600\\\") Places the cursor before the specified resource ID. Used for pagination. \"]}, {\"level\": 2, \"title\": \"Building Queries\", \"body\": [\" Queries are passed to an endpoint through the queries parameter as an array of query strings, which can be generated using the Query class.\", \"Each query method is logically separated via AND operations. For OR operation, pass multiple values into the query method separated by commas. For example Query.equal('title', ['Avatar', 'Lord of the Rings']) will fetch the movies \\\"Avatar\\\" or \\\"Lord of the Rings\\\".\", \" Web import { Client, Databases, Query } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n\\ndatabases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.equal('title', ['Avatar', 'Lord of the Rings']),\\n Query.greaterThan('year', 1999)\\n ]\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n try {\\n final documents = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.equal('title', ['Avatar', 'Lord of the Rings']),\\n Query.greaterThan('year', 1999)\\n ]\\n );\\n } on AppwriteException catch(e) {\\n print(e);\\n }\\n} Android import io.appwrite.Client\\nimport io.appwrite.Query\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n val databases = Databases(client)\\n\\n try {\\n val documents = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = listOf(\\n Query.equal(\\\"title\\\", listOf(\\\"Avatar\\\", \\\"Lord of the Rings\\\")),\\n Query.greaterThan(\\\"year\\\", 1999)\\n )\\n )\\n } catch (e: AppwriteException) {\\n Log.e(\\\"Appwrite\\\", e.message)\\n }\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n do {\\n let documents = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.equal(\\\"title\\\", [\\\"Avatar\\\", \\\"Lord of the Rings\\\"]),\\n Query.greaterThan(\\\"year\\\", 1999)\\n ]\\n )\\n } catch {\\n print(error.localizedDescription)\\n }\\n} GraphQL query {\\n databasesListDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\"\\n queries: [\\\"equal(\\\\\\\"title\\\\\\\", [\\\\\\\"Avatar\\\\\\\", \\\\\\\"Lord of the Rings\\\\\\\"])\\\", \\\"greaterThan(\\\\\\\"year\\\\\\\", 1999)\\\"]\\n ) {\\n total\\n documents {\\n _id\\n data\\n }\\n }\\n} \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/databases-queries"}} \ No newline at end of file diff --git a/docs/ee43bfe8-1f0c-11ee-98fa-00155da08df7.json b/docs/4eec7438-4583-11ee-9922-f2ea36f81204.json similarity index 98% rename from docs/ee43bfe8-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eec7438-4583-11ee-9922-f2ea36f81204.json index 2ac826f..961b8cf 100644 --- a/docs/ee43bfe8-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eec7438-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Pagination \", \"body\": [\" Pagination is the process of dividing data into discrete pages. In Appwrite, it is achieved by using an offset or a cursor, which both come with their own use case and benefits.\"]}, {\"level\": 2, \"title\": \"Offset Pagination\", \"body\": [\" Using Query.limit() and Query.offset() you can achieve one of the most common approaches to pagination. With Query.limit() you can define to how many documents that can be returned from one request. The Query.offset() is simply the number of records you wish to skip before selecting records.\", \" Web import { Client, Databases, Query } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n \\n// Page 1\\nconst page1 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n);\\n\\n// Page 2\\nconst page2 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n final page1 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n );\\n\\n final page2 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n );\\n}\\n Android import io.appwrite.Client\\nimport io.appwrite.Query\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val databases = Databases(client)\\n\\n val page1 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n )\\n\\n val page2 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n )\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n let page1 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n )\\n\\n let page2 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n )\\n} \", \" The request gets slower as the number of records increases because the database has to read up to the offset number of rows to know where it should start selecting data. Also when there is data added in high frequency - the individual pages might skip results.\"]}, {\"level\": 2, \"title\": \"Cursor Pagination\", \"body\": [\" The cursor is a unique identifier for a document that points to where the next page should start. After reading a page of documents, pass the last document's ID into the Query.cursorAfter(lastId) query method to get the next page of documents. Pass the first document's ID into the Query.cursorBefore(firstId) query method to retrieve the previous page.\", \" Web import { Databases, Query } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\");\\n\\nconst databases = new Databases(client);\\n\\n// Page 1\\nconst page1 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n ]\\n);\\n\\nconst lastId = page1.documents[page1.documents.length - 1].$id;\\n\\n// Page 2\\nconst page2 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n Query.cursorAfter(lastId),\\n ]\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n final page1 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25)\\n ]\\n );\\n\\n final lastId = page1.documents[page1.documents.length - 1].$id;\\n\\n final page2 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25),\\n Query.cursorAfter(lastId)\\n ]\\n );\\n\\n}\\n Android import android.util.Log\\nimport io.appwrite.AppwriteException\\nimport io.appwrite.Client\\nimport io.appwrite.Query\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val databases = Databases(client)\\n\\n val page1 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25)\\n ]\\n )\\n\\n val lastId = page1.documents[page1.documents.size - 1].$id\\n\\n val page2 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25),\\n Query.cursorAfter(lastId)\\n ]\\n )\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n let page1 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25)\\n ]\\n )\\n\\n let lastId = page1.documents[page1.documents.count - 1].$id\\n\\n let page2 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25),\\n Query.cursorAfter(lastId)\\n ]\\n )\\n} \"]}]", "metadata": {"source": "https://appwrite.io/docs/databases-pagination"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Pagination \", \"body\": [\" Pagination is the process of dividing data into discrete pages. In Appwrite, it is achieved by using an offset or a cursor, which both come with their own use case and benefits.\"]}, {\"level\": 2, \"title\": \"Offset Pagination\", \"body\": [\" Using Query.limit() and Query.offset() you can achieve one of the most common approaches to pagination. With Query.limit() you can define to how many documents that can be returned from one request. The Query.offset() is simply the number of records you wish to skip before selecting records.\", \" Web import { Client, Databases, Query } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n \\n// Page 1\\nconst page1 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n);\\n\\n// Page 2\\nconst page2 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n final page1 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n );\\n\\n final page2 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n );\\n}\\n Android import io.appwrite.Client\\nimport io.appwrite.Query\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val databases = Databases(client)\\n\\n val page1 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n )\\n\\n val page2 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n )\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n let page1 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n )\\n\\n let page2 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n )\\n} \", \" The request gets slower as the number of records increases because the database has to read up to the offset number of rows to know where it should start selecting data. Also when there is data added in high frequency - the individual pages might skip results.\"]}, {\"level\": 2, \"title\": \"Cursor Pagination\", \"body\": [\" The cursor is a unique identifier for a document that points to where the next page should start. After reading a page of documents, pass the last document's ID into the Query.cursorAfter(lastId) query method to get the next page of documents. Pass the first document's ID into the Query.cursorBefore(firstId) query method to retrieve the previous page.\", \" Web import { Databases, Query } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\");\\n\\nconst databases = new Databases(client);\\n\\n// Page 1\\nconst page1 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n ]\\n);\\n\\nconst lastId = page1.documents[page1.documents.length - 1].$id;\\n\\n// Page 2\\nconst page2 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n Query.cursorAfter(lastId),\\n ]\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n final page1 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25)\\n ]\\n );\\n\\n final lastId = page1.documents[page1.documents.length - 1].$id;\\n\\n final page2 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25),\\n Query.cursorAfter(lastId)\\n ]\\n );\\n\\n}\\n Android import android.util.Log\\nimport io.appwrite.AppwriteException\\nimport io.appwrite.Client\\nimport io.appwrite.Query\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val databases = Databases(client)\\n\\n val page1 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25)\\n ]\\n )\\n\\n val lastId = page1.documents[page1.documents.size - 1].$id\\n\\n val page2 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25),\\n Query.cursorAfter(lastId)\\n ]\\n )\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n let page1 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25)\\n ]\\n )\\n\\n let lastId = page1.documents[page1.documents.count - 1].$id\\n\\n let page2 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25),\\n Query.cursorAfter(lastId)\\n ]\\n )\\n} \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/databases-pagination"}} \ No newline at end of file diff --git a/docs/4eec7b40-4583-11ee-9922-f2ea36f81204.json b/docs/4eec7b40-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..fa27ebd --- /dev/null +++ b/docs/4eec7b40-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Relationships (Beta) \", \"body\": [\"Relationships describe how documents in different collections are associated, so that related documents can be read, updated, or deleted together. Entities in real-life often associate with each other in an organic and logical way, like a person and their dog, an album and its songs, or friends in a social network. These types of association between entities can be modeled in Appwrite using relationships.\", \" Experimental Feature Appwrite Relationships is an experimental feature. The API and behavior are subject to change in future versions.\"]}, {\"level\": 2, \"title\": \"When to Use a Relationship\", \"body\": [\"Relationships help reduce redundant information. For example, a user can create many posts in your app. You can model this without relationships by keeping a copy of the user's information in all the documents representing posts, but this creates a lot of duplicate information in your database about the user.\"]}, {\"level\": 3, \"title\": \"Benefits of Relationships\", \"body\": [\"Duplicated records waste storage, but more importantly, makes the database much harder to maintain. If the user changes their user name, you will have to update dozens or hundreds of records, a problem commonly known as an update anomaly in databases. You can avoid duplicate information by storing users and posts in separate collections and relating a user and their posts through a relationship.\"]}, {\"level\": 3, \"title\": \"Tradeoff\", \"body\": [\"Consider using relationships when the same information is found in multiple places to avoid duplicates. However, relationships come with the tradeoff of slowing down queries. For applications where the best read and write performance is important, it may be acceptable to tolerate duplicate data.\"]}, {\"level\": 2, \"title\": \"Configurable Options\", \"body\": []}, {\"level\": 3, \"title\": \"Directionality\", \"body\": [\"Appwrite relationships can be one-way or two-way.\", \" Type Description One-way The relationship is only visible to one side of the relation. This is similar to a tree data structure, where a tree has a reference to all of its leaves, but each leaf does not have a reference to its tree root. Two-way The relationship is visible to both sides of the relationship. This is similar to a graph data structure, where each node has references to all its edges, and all its edges can reference the nodes it connects. \"]}, {\"level\": 3, \"title\": \"Types\", \"body\": [\"Appwrite provides four different relationship types to enforce different associative rules between documents.\", \" Type Description One-to-one A document can only be related to one and only one document. If you try to relate multiple documents in a one-to-one relationship, Appwrite throws an error. For example, one user has one profile. One-to-many A document can be related to many other documents. For example, one user can create many posts. Many-to-one Many documents can be related to a single document. For example, many posts can share one author. Many-to-many A document can be related to many other documents. For example, a user can have many friends, and many users can share the same friend. \"]}, {\"level\": 3, \"title\": \"On-Delete Behavior\", \"body\": [\" Appwrite also allows you to define the behavior of a relationship when a document is deleted.\", \" Type Description Restrict If a document has at least one related document, it cannot be deleted. Cascade If a document has related documents, when it is deleted, the related documents are also deleted. Set null If a document has related documents, when it is deleted, the related documents are kept with their relationship attribute set to null. \"]}, {\"level\": 2, \"title\": \"Relationship Attributes\", \"body\": [\"Relationships are represented in a collection using relationship attributes. The relationship attribute contains the ID of related documents, which it references during read, update, and delete operations. This attribute is null if a document has no related documents.\"]}, {\"level\": 2, \"title\": \"Creating Relationships in the Appwrite Console\", \"body\": [\"You can create relationships in the Appwrite Console by adding a relationship attribute to a collection.\", \" In your project, navigate to Databases > Select your database > Select your collection > Attributes > Create attribute. Select Relationship as the attribute type. In the Relationship modal, select the relationship type and pick the related collection and attributes. Pick relationship attribute key(s) to represent the related collection. Relationship attribute keys are used to reference the related collection in queries, so pick something that's intuitive and easy to remember. Select desired on delete behavior. Click the Create button to create the relationship.\"]}, {\"level\": 2, \"title\": \"Creating Relationships Programmatically\", \"body\": [\" Node.js const { Client, Databases } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\ndatabases.createRelationshipAttribute(\\n 'marvel', // Database ID\\n 'movies', // Collection ID\\n 'reviews', // Related collection ID\\n 'oneToMany', // Relationship type\\n true, // Is two-way\\n 'reviews', // Attribute key \\n 'movie', // Two-way attribute key\\n 'cascade' // On delete action\\n); PHP use \\\\Appwrite\\\\Client;\\nuse \\\\Appwrite\\\\Services\\\\Databases;\\n\\n$client = (new Client())\\n ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n ->setProject('[PROJECT_ID]'); // Your project ID\\n\\n$databases = new Databases($client);\\n\\n$databases->createRelationshipAttribute(\\n databaseId: 'marvel', // Database ID\\n collectionId: 'movies', // Collection ID\\n relatedCollectionId: 'reviews', // Related collection ID\\n type: 'oneToMany', // Relationship type\\n twoWay: true, // Is two-way\\n key: 'reviews', // Attribute key \\n twoWayKey: 'movie', // Two-way attribute key\\n onDelete: 'cascade' // On delete action\\n); Python from appwrite.client import Client\\nfrom appwrite.services.databases import Databases\\n\\nclient = (Client()\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]')) # Your project ID\\n\\ndatabases = Databases(client)\\n\\ndatabases.create_relationship_attribute(\\n database_id='marvel', # Database ID \\n collection_id='movies', # Collection ID\\n related_collection_id='reviews', # Related collection ID \\n type='oneToMany', # Relationship type\\n two_way=True, # Is two-way\\n key='reviews', # Attribute key \\n two_way_key='movie', # Two-way attribute key\\n on_delete='cascade' # On delete action\\n) Ruby require 'appwrite'\\n\\ninclude Appwrite\\n\\nclient = Client.new\\n .set_endpoint('https://cloud.appwrite.io/v1')# Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n\\ndatabases = Databases.new(client)\\n\\ndatabases.create_relationship_attribute(\\n database_id: 'marvel', # Database ID \\n collection_id: 'movies', # Collection ID \\n related_collection_id: 'reviews', # Related collection ID \\n type: 'oneToMany', # Relationship type\\n two_way: true, # Is two-way\\n key: 'reviews', # Attribute key \\n two_way_key: 'movie', # Two-way attribute key \\n on_delete: 'cascade' # On delete action\\n) Deno import { Client, Databases } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n\\nconst client = new Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\"); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\ndatabases.createRelationshipAttribute(\\n \\\"marvel\\\", // Database ID \\n \\\"movies\\\", // Collection ID \\n \\\"reviews\\\", // Related collection ID \\n \\\"oneToMany\\\", // Relationship type \\n true, // Is two-way \\n \\\"reviews\\\", // Attribute key \\n \\\"movie\\\", // Two-way attribute key \\n \\\"cascade\\\" // On delete action \\n); Dart import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal databases = Databases(client);\\n\\nawait databases.createRelationshipAttribute(\\n databaseId: 'marvel', // Database ID \\n collectionId: 'movies', // Collection ID \\n relatedCollectionId: 'reviews', // Related collection ID \\n type: 'oneToMany', // Relationship type \\n twoWay: true, // Is two-way \\n key: 'reviews', // Attribute key \\n twoWayKey: 'movie', // Two-way attribute key \\n onDelete: 'cascade', // On delete action \\n); Kotlin import io.appwrite.Client\\nimport io.appwrite.services.Databases\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval databases = Databases(client)\\n\\ndatabases.createRelationshipAttribute(\\n databaseId = \\\"marvel\\\", // Database ID \\n collectionId = \\\"movies\\\", // Collection ID \\n relatedCollectionId = \\\"reviews\\\", // Related collection ID \\n type = \\\"oneToMany\\\", // Relationship type \\n twoWay = true, // Is two-way \\n key = \\\"reviews\\\", // Attribute key \\n twoWayKey = \\\"movie\\\", // Two-way attribute key \\n onDelete = \\\"cascade\\\" // On delete action \\n) Swift import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet databases = Databases(client)\\n\\ndatabases.createRelationshipAttribute(\\n databaseId: \\\"marvel\\\", // Database ID \\n collectionId: \\\"movies\\\", // Collection ID \\n relatedCollectionId: \\\"reviews\\\", // Related collection ID \\n type: \\\"oneToMany\\\", // Relationship type \\n twoWay: true, // Is two-way \\n key: \\\"reviews\\\", // Attribute key \\n twoWayKey: \\\"movie\\\", // Two-way attribute key \\n onDelete: \\\"cascade\\\" // On delete action \\n) .NET using Appwrite;\\nusing Appwrite.Services;\\n\\nvar client = new Client()\\n .SetEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .SetProject(\\\"[PROJECT_ID]\\\");\\n\\nvar databases = new Databases(client);\\n\\nawait databases.CreateRelationshipAttribute(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n relatedCollectionId: \\\"reviews\\\",\\n type: \\\"oneToMany\\\",\\n twoWay: true,\\n key: \\\"reviews\\\",\\n twoWayKey: \\\"movie\\\",\\n onDelete: \\\"cascade\\\"); \", \"The above example adds a relationship between the collections movies and reviews. A relationship attribute with the key reviews is added to the movies collection and another relationship attribute with the key movie is added to the reviews collection.\"]}, {\"level\": 2, \"title\": \"Creating Documents\", \"body\": [\"If a collection has relationship attributes, you can create documents in two ways.\"]}, {\"level\": 3, \"title\": \"Creating Child Documents\", \"body\": [\"You can create both the parent and child at once in a relationship by nesting data.\", \" Web const { Client, Databases, ID } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\nawait databases.createDocument(\\n 'marvel',\\n 'movies',\\n ID.unique(),\\n {\\n title: 'Spiderman',\\n year: 2002,\\n reviews: [\\n { author: 'Bob', text: 'Great movie!' },\\n { author: 'Alice', text: 'Loved it!' }\\n ]\\n }\\n) Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal databases = Databases(client);\\n\\nawait databases.createDocument(\\n databaseId: 'marvel',\\n collectionId: 'movies',\\n documentId: ID.unique(),\\n data: {\\n 'title': 'Spiderman',\\n 'year': 2002,\\n 'reviews': [\\n { 'author': 'Bob', 'text': 'Great movie!' },\\n { 'author': 'Alice', 'text': 'Loved it!' }\\n ]\\n },\\n); Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet databases = Database(client: client)\\n\\ndatabases.createDocument(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n documentId: ID.unique(),\\n data: [\\n \\\"title\\\": \\\"Spiderman\\\",\\n \\\"year\\\": 2002,\\n \\\"reviews\\\": [\\n [ \\\"author\\\": \\\"Bob\\\", \\\"text\\\": \\\"Great movie!\\\" ],\\n [ \\\"author\\\": \\\"Alice\\\", \\\"text\\\": \\\"Loved it!\\\" ]\\n ]\\n ]\\n) Android import io.appwrite.Client\\nimport io.appwrite.services.Database\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval databases = Database(client)\\n\\ndatabases.createDocument(\\n databaseId = \\\"marvel\\\",\\n collectionId = \\\"movies\\\",\\n documentId = ID.unique(),\\n data = mapOf(\\n \\\"title\\\" to \\\"Spiderman\\\",\\n \\\"year\\\" to 2002,\\n \\\"reviews\\\" to listOf(\\n mapOf(\\\"author\\\" to \\\"Bob\\\", \\\"text\\\" to \\\"Great movie!\\\"),\\n mapOf(\\\"author\\\" to \\\"Alice\\\", \\\"text\\\" to \\\"Loved it!\\\")\\n )\\n )\\n) \", \"If a nested child document is included and no child document ID is provided, the child document will be given a unique ID.\", \"If a nested child document is included and no conflicting child document ID exists, the child document will be created.\", \"If a nested child document is included and the child document ID already exists, the child document will be updated.\"]}, {\"level\": 3, \"title\": \"Reference Child Documents\", \"body\": [\"If the child documents are already present in the related collection, you can create the parent and reference the child documents using their IDs.\", \" Web const { Client, Databases, ID } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\nawait databases.createDocument(\\n 'marvel',\\n 'movies',\\n ID.unique(),\\n {\\n title: 'Spiderman',\\n year: 2002,\\n reviews: [\\n 'review1',\\n 'review2'\\n ]\\n }\\n) Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint \\n .setProject('[PROJECT_ID]'); // Your project ID \\n\\nfinal databases = Databases(client);\\n\\nawait databases.createDocument(\\n databaseId: 'marvel',\\n collectionId: 'movies',\\n documentId: ID.unique(),\\n data: {\\n 'title': 'Spiderman',\\n 'year': 2002,\\n 'reviews': [\\n 'review1',\\n 'review2'\\n ]\\n },\\n); Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint \\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID \\n\\nlet databases = Database(client: client)\\n\\ndatabases.createDocument(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n documentId: ID.unique(),\\n data: [\\n \\\"title\\\": \\\"Spiderman\\\",\\n \\\"year\\\": 2002,\\n \\\"reviews\\\": [\\n \\\"review1\\\",\\n \\\"review2\\\"\\n ]\\n ]\\n) Android import io.appwrite.Client\\nimport io.appwrite.services.Database\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint \\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID \\n\\nval databases = Database(client)\\n\\ndatabases.createDocument(\\n databaseId = \\\"marvel\\\",\\n collectionId = \\\"movies\\\",\\n documentId = ID.unique(),\\n data = mapOf(\\n \\\"title\\\" to \\\"Spiderman\\\",\\n \\\"year\\\" to 2002,\\n \\\"reviews\\\" to listOf(\\n \\\"review1\\\",\\n \\\"review2\\\"\\n )\\n )\\n) \"]}, {\"level\": 2, \"title\": \"Querying\", \"body\": [\"Querying is currently not available in the experimental version of Appwrite Relationships but will be added in a later version.\"]}, {\"level\": 2, \"title\": \"Updating Relationships\", \"body\": [\"Relationships can be updated by updating the relationship attribute.\", \" Web const { Client, Databases } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\nawait databases.updateDocument(\\n 'marvel',\\n 'movies',\\n 'spiderman',\\n {\\n title: 'Spiderman',\\n year: 2002,\\n reviews: [\\n 'review4',\\n 'review5'\\n ]\\n }\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal databases = Databases(client);\\n\\nawait databases.updateDocument(\\n databaseId: 'marvel',\\n collectionId: 'movies',\\n documentId: 'spiderman',\\n data: {\\n 'title': 'Spiderman',\\n 'year': 2002,\\n 'reviews': [\\n 'review4',\\n 'review5'\\n ]\\n },\\n); Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet databases = Database(client: client)\\n\\ndatabases.updateDocument(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n documentId: \\\"spiderman\\\",\\n data: [\\n \\\"title\\\": \\\"Spiderman\\\",\\n \\\"year\\\": 2002,\\n \\\"reviews\\\": [\\n \\\"review4\\\",\\n \\\"review5\\\"\\n ]\\n ]\\n) Android import io.appwrite.Client\\nimport io.appwrite.services.Database\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nval databases = Database(client)\\n\\ndatabases.updateDocument(\\n databaseId = \\\"marvel\\\",\\n collectionId = \\\"movies\\\",\\n documentId = \\\"spiderman\\\",\\n data = mapOf(\\n \\\"title\\\" to \\\"Spiderman\\\",\\n \\\"year\\\" to 2002,\\n \\\"reviews\\\" to listOf(\\n \\\"review4\\\",\\n \\\"review5\\\"\\n )\\n )\\n) \"]}, {\"level\": 2, \"title\": \"Deleting Relationships\", \"body\": []}, {\"level\": 3, \"title\": \"Unlink Relationships, Retain Documents\", \"body\": [\"If you need to unlink documents in a relationship but retain the documents, you can do this by updating the relationship attribute and removing the ID of the related document.\", \"If a document can be related to only one document, you can delete the relationship by setting the relationship attribute to null.\", \"If a document can be related to more than one document, you can delete the relationship by setting the relationship attribute to an empty list.\"]}, {\"level\": 3, \"title\": \"Deleting Relationships and Documents\", \"body\": [\"If you need to delete the documents as well as unlink the relationship, the approach depends on the on-delete behavior of a relationship.\", \"If the on-delete behavior is restrict, the link between the documents needs to be deleted first before the documents can be deleted individually.\", \"If the on-delete behavior is set null, deleting a document will leave related documents in place with their relationship attribute set to null. If you wish to also delete related documents, they must be deleted individually.\", \"If the on-delete behavior is cascade, deleting the parent documents also deletes related child documents, except for many-to-one relationships. In many-to-one relationships, there are multiple parent documents related to a single child document, and when the child document is deleted, the parents are deleted in cascade.\", \" Web const { Client, Databases } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\nawait databases.deleteDocument(\\n 'marvel',\\n 'movies',\\n 'spiderman'\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal databases = Databases(client);\\n\\nawait databases.deleteDocument(\\n databaseId: 'marvel',\\n collectionId: 'movies',\\n documentId: 'spiderman'\\n); Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet databases = Database(client: client)\\n\\ndatabases.deleteDocument(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n documentId: \\\"spiderman\\\"\\n) Android import io.appwrite.Client\\nimport io.appwrite.services.Database\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nval databases = Database(client)\\n\\ndatabases.deleteDocument(\\n databaseId = \\\"marvel\\\",\\n collectionId = \\\"movies\\\",\\n documentId = \\\"spiderman\\\"\\n) \"]}, {\"level\": 2, \"title\": \"Permissions\", \"body\": [\"To access documents in a relationship, you must have permission to access both the parent and child documents.\", \"When creating both the parent and child documents, the child document will inherit permissions from its parent.\", \"You can also provide explicit permissions to the child document if they should be different from their parent.\", \" Web const { Client, Databases, ID } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\nawait databases.createDocument(\\n 'marvel',\\n 'movies',\\n ID.unique(),\\n {\\n title: 'Spiderman',\\n year: 2002,\\n reviews: [\\n { \\n author: 'Bob', \\n text: 'Great movie!',\\n $permissions: [\\n Permission.read(Role.any())\\n ]\\n },\\n ]\\n }\\n) Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal databases = Databases(client);\\n\\nawait databases.createDocument(\\n databaseId: 'marvel',\\n collectionId: 'movies',\\n documentId: ID.unique(),\\n data: {\\n 'title': 'Spiderman',\\n 'year': 2002,\\n 'reviews': [\\n { \\n 'author': 'Bob', \\n 'text:' 'Great movie!',\\n '\\\\$permissions': [\\n Permission.read(Role.any())\\n ]\\n },\\n ]\\n },\\n); Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet databases = Database(client: client)\\n\\ndatabases.createDocument(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n documentId: ID.unique(),\\n data: [\\n \\\"title\\\": \\\"Spiderman\\\",\\n \\\"year\\\": 2002,\\n \\\"reviews\\\": [\\n [ \\n \\\"author\\\": \\\"Bob\\\",\\n \\\"text\\\": \\\"Great movie!\\\",\\n \\\"$permissions\\\": [\\n Permission.read(Role.any())\\n ]\\n ],\\n ]\\n ]\\n) Android import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet databases = Database(client: client)\\n\\ndatabases.createDocument(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n documentId: ID.unique(),\\n data: [\\n \\\"title\\\": \\\"Spiderman\\\",\\n \\\"year\\\": 2002,\\n \\\"reviews\\\": [\\n [ \\n \\\"author\\\": \\\"Bob\\\",\\n \\\"text\\\": \\\"Great movie!\\\",\\n \\\"$permissions\\\": [\\n Permission.read(Role.any())\\n ]\\n ],\\n ]\\n ]\\n) \", \"When creating, updating, or deleting in a relationship, you must have permission to access all documents referenced. If the user does not have read permission to any document, an exception will be thrown.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/databases-relationships"}} \ No newline at end of file diff --git a/docs/8c294318-f62c-11ed-8355-0242c0a89002.json b/docs/4eec8892-4583-11ee-9922-f2ea36f81204.json similarity index 81% rename from docs/8c294318-f62c-11ed-8355-0242c0a89002.json rename to docs/4eec8892-4583-11ee-9922-f2ea36f81204.json index e0d7528..aad648f 100644 --- a/docs/8c294318-f62c-11ed-8355-0242c0a89002.json +++ b/docs/4eec8892-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Storage \", \"body\": [\"Appwrite Storage allows you to manage files in your project. You can use it to store images, videos, documents, and other files for your projects. It provides APIs to upload, download, delete, and list files. Not only that Appwrite storage service provides APIs to manipulate images. Using the preview endpoint, you can crop, resize, rotate, add borders and border-radius and select the desired output format for your image. The preview API also allows you to change your image's quality, format, or compression, including WebP support for maximum optimization of your network bandwidth.\"]}, {\"level\": 2, \"title\": \"Buckets\", \"body\": [\"Storage buckets are similar to collections in the Databases service. The difference is buckets also provide more power to decide what kinds of files, what sizes you want to allow in that bucket, whether or not to encrypt the files, scan with antivirus, and more. Let's look at how we can create a bucket and configure it to your needs.\"]}, {\"level\": 3, \"title\": \"Create Bucket\", \"body\": [\"You can create your bucket from your Appwrite project's dashboard, using any of our server-side SDKs, or directly using our REST API authenticated using an API Key. To create a bucket from the Appwrite Console, access your Storage dashboard from your project's left navigation panel. Click Add Bucket button and choose your bucket's name. You can also set a custom ID for your bucket instead of an auto-generated ID for convenience. This will create a new bucket and take you to its settings page, where you can configure various options for your bucket.\", \"You can manage your buckets programmatically using one of Appwrite's Server SDKs or REST API paired with an API Key. You can manage files with both Server and Client side.\"]}, {\"level\": 4, \"title\": \"Permissions\", \"body\": [\"The Storage Service allows you to configure permissions at both the bucket level and the file level. When a user has the appropriate type of access permissions granted at either the bucket or the file level, they will be able to access the file. If the permission field is left empty, no one can access the file.\"]}, {\"level\": 5, \"title\": \"File Level Permissions\", \"body\": [\"File level permissions grant access to individual files. File level permissions are only enabled if File Security is enabled in the settings of your bucket.\"]}, {\"level\": 5, \"title\": \"Bucket Level Permissions\", \"body\": [\"Bucket level permissions apply to every file in the bucket.\"]}, {\"level\": 4, \"title\": \"More Bucket Configurations\", \"body\": [\"Storage buckets have many configuration options, including the type and maximum size of files in the bucket, whether encryption or anti-virus is enabled, and the compression algorithm to use. If you look at the bucket settings or the REST API example above, you can find these configurations. Let's look at what those are:\", \" Parameter Description allowedFileExtensions This parameter allows you to provide a list of file extensions that will be accepted into the bucket. maximumFileSize This parameter allows you to set the maximum size of a file that a bucket accepts. The buckets will accept any file less than or equal to the size provided here. encryption This parameter allows you to configure whether or not the files inside the bucket will be encrypted. We don't encrypt files bigger than 20MB. antivirus This parameter allows you to configure whether or not the files being added inside the bucket be scanned by antivirus. We don't scan files bigger than 20MB. \", \"You can learn more about storage buckets and APIs you can use to manage storage buckets from our Storage documentation. Now that we know how to create and configure buckets for our applications, let's look at how to manage files using the storage service.\"]}, {\"level\": 2, \"title\": \"Create File\", \"body\": [\"After you create a bucket or have navigated to bucket details, you can access the Files tab so you can upload, view, delete and update files in the bucket using the Appwrite project's dashboard. You can also perform all those operations from Appwrite's client SDK, server SDKs, and REST APIs as long as you have the proper permission.\", \"When you are in the Files tab, you can click Add File and select a file to upload. If the bucket is configured to accept the file type and size you are uploading, your file will be uploaded, and you will see the file in the list of files.\", \"You can also upload files programmatically using our SDKs:\", \" Web import { Client, Storage } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst storage = new Storage(client);\\n\\nconst promise = storage.createFile(\\n '[BUCKET_ID]',\\n ID.unique(),\\n document.getElementById('uploader').files[0]\\n);\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n});\\n Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() { // Init SDK\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final storage = Storage(client);\\n\\n final file = await storage.createFile(\\n bucketId: '[BUCKET_ID]',\\n fileId: ID.unique(),\\n file: InputFile.fromPath(path: './path-to-files/image.jpg', filename: 'image.jpg'),\\n );\\n} Android import io.appwrite.Client\\nimport io.appwrite.services.Storage\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\n val storage = Storage(client)\\n\\n val file = storage.createFile(\\n bucketId = \\\"[BUCKET_ID]\\\",\\n fileId = ID.unique(),\\n file = File(\\\"./path-to-files/image.jpg\\\"),\\n )\\n} Apple import Appwrite\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let storage = Storage(client)\\n\\n let file = try await storage.createFile(\\n bucketId: \\\"[BUCKET_ID]\\\",\\n fileId: ID.unique(),\\n file: InputFile.fromBuffer(yourByteBuffer,\\n filename: \\\"image.jpg\\\",\\n mimeType: \\\"image/jpeg\\\"\\n )\\n )\\n} GraphQL POST /v1/storage/buckets/{bucketId}/files HTTP/1.1\\nContent-Type: multipart/form-data; boundary=\\\"cec8e8123c05ba25\\\"\\nContent-Length: *Length of your entity body in bytes*\\nX-Appwrite-Project: [PROJECT_ID]\\n\\n--cec8e8123c05ba25\\nContent-Disposition: form-data; name=\\\"operations\\\"\\n\\n{ \\\"query\\\": \\\"mutation CreateFile($bucketId: String!, $fileId: String!, $file: InputFile!) { storageCreateFile(bucketId: $bucketId, fileId: $fileId, file: $file) { id } }\\\", \\\"variables\\\": { \\\"bucketId\\\": \\\"[BUCKET_ID]\\\", \\\"fileId\\\": \\\"[FILE_ID]\\\", \\\"file\\\": null } }\\n--cec8e8123c05ba25\\nContent-Disposition: form-data; name=\\\"map\\\"\\n\\n{ \\\"0\\\": [\\\"variables.file\\\"] }\\n--cec8e8123c05ba25\\nContent-Disposition: form-data; name=\\\"0\\\"; filename=\\\"file.txt\\\"\\nContent-Type: text/plain\\n\\nFile content.\\n\\n--cec8e8123c05ba25-- \", \" When you are trying to upload any files above 5MB, you will need to upload them in chunks for better reliability and performance. If you're using an Appwrite SDK, this is handled automatically. If you're not using an SDK, you can learn more about file handling in the REST API docs.\"]}, {\"level\": 2, \"title\": \"File Input\", \"body\": [\" Every language and platform handles file inputs differently. This section documents the expected input type of each SDK. Where applicable, Appwrite provides a InputFile class to accept multiple file sources, like paths, buffers, streams, or plain text.\"]}, {\"level\": 3, \"title\": \"Client SDK\", \"body\": [\" Web The Appwrite Web SDK expects a File object for file creation. This is most commonly associated with DOM file inputs. For example, for the input tag , you would call create file like this: const promise = storage.createFile(\\n '[BUCKET_ID]',\\n ID.unique(),\\n document.getElementById('uploader').files[0]\\n); Flutter The Appwrite Flutter SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(path: [PATH], filename: [NAME], contentType: [MIME TYPE]) Used to upload files from a provided path, filename and contentType are optional. Used for Flutter apps on mobile and desktop. InputFile.fromBytes(bytes: [BYTE LIST], filename: [NAME], contentType: [MIME TYPE]) Used to upload files from a byte list, contentType is optional. Used for Flutter apps on web Android The Appwrite Android SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(path: String) Used to upload files from a provided path. InputFile.fromFile(file: File) Used to upload files from a File object. InputFile.fromBytes(bytes: ByteArray, filename: String, mimeType: String) Used to upload files from a ByteArray object. Specify the file MIME type using the mimeType param. Apple The Appwrite Apple SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(_ path: String) Used to upload files from a provided path. InputFile.fromData(_ data: Data, filename: String, mimeType: String) Used to upload files from a Data object. Specify the file MIME type using the mimeType param. InputFile.fromBuffer(_ buffer: ByteBuffer, filename: String, mimeType: String) Used to upload files from a NIO Buffer object. Specify the file MIME type using the mimeType param. \"]}, {\"level\": 3, \"title\": \"Server SDK\", \"body\": [\" Node.js The Appwrite NodeJS SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(filePath, filename) Used to upload files from a provided path. InputFile.fromBuffer(buffer, filename) Used to upload files from a Buffer object. InputFile.fromBlob(blob, filename) Used to upload files from a Blob object. InputFile.fromStream(stream, filename, size) Used to upload files from a Readable Stream object. InputFile.fromPlainText(content, filename) Used to upload files in plain text. Expects a string encoded in UTF-8. PHP The Appwrite PHP SDK expects an InputFile class for file inputs. Method Description InputFile.withPath(string $path, ?string $mimeType = null, ?string $filename = null) Used to upload files from a provided path. InputFile.withData(string $data, ?string $mimeType = null, ?string $filename = null) Used to upload files from a string. Python The Appwrite Python SDK expects an InputFile class for file inputs. Method Description InputFile.from_path(path) Used to upload files from a provided path. InputFile.from_bytes(bytes) Used to upload files from an array of bytes. Ruby The Appwrite Ruby SDK expects an InputFile class for file inputs. Method Description InputFile.from_path(path) Used to upload files from a provided path. InputFile.from_string(string) Used to upload files from a String. InputFile.from_bytes(bytes) Used to upload files from an array of bytes. Deno The Appwrite Deno SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(filePath, filename) Used to upload files from a provided path. InputFile.fromBuffer(buffer, filename) Used to upload files from a Uint8Array object. InputFile.fromPlainText(content, filename) Used to upload files in plain text. Expects a string encoded in UTF-8. Dart The Appwrite Dart SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(path: [PATH], filename: [NAME], contentType: [MIME TYPE]) Used to upload files from a provided path, filename and contentType are optional. InputFile.fromBytes(bytes: [BYTE LIST], filename: [NAME], contentType: [MIME TYPE]) Used to upload files from a byte list, contentType is optional. Kotlin The Appwrite Kotlin SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(path: String) Used to upload files from a provided path. InputFile.fromFile(file: File) Used to upload files from a File object. InputFile.fromBytes(bytes: ByteArray, filename: String, mimeType: String) Used to upload files from a ByteArray object. Specify the file MIME type using the mimeType param. Swift The Appwrite Swift SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(_ path: String) Used to upload files from a provided path. InputFile.fromData(_ data: Data, filename: String, mimeType: String) Used to upload files from a Data object. Specify the file MIME type using the mimeType param. InputFile.fromBuffer(_ buffer: ByteBuffer, filename: String, mimeType: String) Used to upload files from a NIO Buffer object. Specify the file MIME type using the mimeType param. \"]}, {\"level\": 2, \"title\": \"Image Manipulation\", \"body\": [\"Another great built-in feature of Appwrite is the image manipulation feature. With Appwrite Storage's preview endpoint you can manipulate resolution, add borders and the border-radius, add background-color, set the opacity for the image, and get the image in the appropriate output format.\", \"This enables a wide range of possibilities! You can manipulate images resolution to display appropriately on responsive websites. You can also adjust the image border, background color, and border-radius to match the theming of your application. The Appwrite Storage also allows you to change the format and compression of your images for network transfer optimization and to help you speed your application. You can do all that without caring about how the image was originally uploaded.\", \"Below you can find all the different parameters offered by the preview endpoint to manipulate the image.\", \" Parameter Description height Set the height of the output image in pixels, the image will be resized keeping the aspect ratio intact. Accepts integer between 0-4000 width Set the width of the output image in pixels, the image will be resized keeping the aspect ratio intact. Accepts integer between 0-4000 gravity The gravity while cropping the image providing either width, height or both. Accepts any of: center, top-left, top, top-right, left, right, bottom-left, bottom, bottom-right quality Set the quality of the output image. Accepts integer between 0-100, where 100 is the highest quality. borderWidth Set a border with given width in pixels to the output image. Accepts integer between 0-100 borderColor Set a border-color for the output image. Accepts any valid Hex color value without the leading #. borderRadius Set a border-radius in pixels. Accepts an integer between 0-4000. opacity Set opacity for the output image. Accepts a float value between 0-1, where 0 makes it transparent. Only works with output format supporting alpha channel like png. rotation Rotate the output image by a degree. Accepts an integer between -360 to 360. background Set a background-color. Accepts any valid Hex color value without the leading #. Only works with output format supporting alpha channel like png. output Set the output image format. If not provided, will use the original image's format. Supported formats are: jpg, jpeg, png, gif and webp \"]}]", "metadata": {"source": "https://appwrite.io/docs/storage"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Storage \", \"body\": [\"Appwrite Storage allows you to manage files in your project. You can use it to store images, videos, documents, and other files for your projects. It provides APIs to upload, download, delete, and list files. Not only that Appwrite storage service provides APIs to manipulate images. Using the preview endpoint, you can crop, resize, rotate, add borders and border-radius and select the desired output format for your image. The preview API also allows you to change your image's quality, format, or compression, including WebP support for maximum optimization of your network bandwidth.\"]}, {\"level\": 2, \"title\": \"Buckets\", \"body\": [\"Storage buckets are similar to collections in the Databases service. The difference is buckets also provide more power to decide what kinds of files, what sizes you want to allow in that bucket, whether or not to encrypt the files, scan with antivirus, and more. Let's look at how we can create a bucket and configure it to your needs.\"]}, {\"level\": 3, \"title\": \"Create Bucket\", \"body\": [\"You can create your bucket from your Appwrite project's dashboard, using any of our server-side SDKs, or directly using our REST API authenticated using an API Key. To create a bucket from the Appwrite Console, access your Storage dashboard from your project's left navigation panel. Click Add Bucket button and choose your bucket's name. You can also set a custom ID for your bucket instead of an auto-generated ID for convenience. This will create a new bucket and take you to its settings page, where you can configure various options for your bucket.\", \"You can manage your buckets programmatically using one of Appwrite's Server SDKs or REST API paired with an API Key. You can manage files with both Server and Client side.\"]}, {\"level\": 4, \"title\": \"Permissions\", \"body\": [\"The Storage Service allows you to configure permissions at both the bucket level and the file level. When a user has the appropriate type of access permissions granted at either the bucket or the file level, they will be able to access the file. If the permission field is left empty, no one can access the file.\"]}, {\"level\": 5, \"title\": \"File Level Permissions\", \"body\": [\"File level permissions grant access to individual files. File level permissions are only enabled if File Security is enabled in the settings of your bucket.\"]}, {\"level\": 5, \"title\": \"Bucket Level Permissions\", \"body\": [\"Bucket level permissions apply to every file in the bucket.\"]}, {\"level\": 4, \"title\": \"More Bucket Configurations\", \"body\": [\"Storage buckets have many configuration options, including the type and maximum size of files in the bucket, whether encryption or anti-virus is enabled, and the compression algorithm to use. If you look at the bucket settings or the REST API example above, you can find these configurations. Let's look at what those are:\", \" Parameter Description allowedFileExtensions This parameter allows you to provide a list of file extensions that will be accepted into the bucket. maximumFileSize This parameter allows you to set the maximum size of a file that a bucket accepts. The buckets will accept any file less than or equal to the size provided here. encryption This parameter allows you to configure whether or not the files inside the bucket will be encrypted. We don't encrypt files bigger than 20MB. antivirus This parameter allows you to configure whether or not the files being added inside the bucket be scanned by antivirus. We don't scan files bigger than 20MB. \", \"You can learn more about storage buckets and APIs you can use to manage storage buckets from our Storage documentation. Now that we know how to create and configure buckets for our applications, let's look at how to manage files using the storage service.\"]}, {\"level\": 2, \"title\": \"Create File\", \"body\": [\"After you create a bucket or have navigated to bucket details, you can access the Files tab so you can upload, view, delete and update files in the bucket using the Appwrite project's dashboard. You can also perform all those operations from Appwrite's client SDK, server SDKs, and REST APIs as long as you have the proper permission.\", \"When you are in the Files tab, you can click Add File and select a file to upload. If the bucket is configured to accept the file type and size you are uploading, your file will be uploaded, and you will see the file in the list of files.\", \"You can also upload files programmatically using our SDKs:\", \" Web import { Client, Storage } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst storage = new Storage(client);\\n\\nconst promise = storage.createFile(\\n '[BUCKET_ID]',\\n ID.unique(),\\n document.getElementById('uploader').files[0]\\n);\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n});\\n Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() { // Init SDK\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final storage = Storage(client);\\n\\n final file = await storage.createFile(\\n bucketId: '[BUCKET_ID]',\\n fileId: ID.unique(),\\n file: InputFile.fromPath(path: './path-to-files/image.jpg', filename: 'image.jpg'),\\n );\\n} Android import io.appwrite.Client\\nimport io.appwrite.services.Storage\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\n val storage = Storage(client)\\n\\n val file = storage.createFile(\\n bucketId = \\\"[BUCKET_ID]\\\",\\n fileId = ID.unique(),\\n file = File(\\\"./path-to-files/image.jpg\\\"),\\n )\\n} Apple import Appwrite\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let storage = Storage(client)\\n\\n let file = try await storage.createFile(\\n bucketId: \\\"[BUCKET_ID]\\\",\\n fileId: ID.unique(),\\n file: InputFile.fromBuffer(yourByteBuffer,\\n filename: \\\"image.jpg\\\",\\n mimeType: \\\"image/jpeg\\\"\\n )\\n )\\n} GraphQL POST /v1/storage/buckets/{bucketId}/files HTTP/1.1\\nContent-Type: multipart/form-data; boundary=\\\"cec8e8123c05ba25\\\"\\nContent-Length: *Length of your entity body in bytes*\\nX-Appwrite-Project: [PROJECT_ID]\\n\\n--cec8e8123c05ba25\\nContent-Disposition: form-data; name=\\\"operations\\\"\\n\\n{ \\\"query\\\": \\\"mutation CreateFile($bucketId: String!, $fileId: String!, $file: InputFile!) { storageCreateFile(bucketId: $bucketId, fileId: $fileId, file: $file) { id } }\\\", \\\"variables\\\": { \\\"bucketId\\\": \\\"[BUCKET_ID]\\\", \\\"fileId\\\": \\\"[FILE_ID]\\\", \\\"file\\\": null } }\\n--cec8e8123c05ba25\\nContent-Disposition: form-data; name=\\\"map\\\"\\n\\n{ \\\"0\\\": [\\\"variables.file\\\"] }\\n--cec8e8123c05ba25\\nContent-Disposition: form-data; name=\\\"0\\\"; filename=\\\"file.txt\\\"\\nContent-Type: text/plain\\n\\nFile content.\\n\\n--cec8e8123c05ba25-- \", \" When you are trying to upload any files above 5MB, you will need to upload them in chunks for better reliability and performance. If you're using an Appwrite SDK, this is handled automatically. If you're not using an SDK, you can learn more about file handling in the REST API docs.\"]}, {\"level\": 2, \"title\": \"File Input\", \"body\": [\" Every language and platform handles file inputs differently. This section documents the expected input type of each SDK. Where applicable, Appwrite provides a InputFile class to accept multiple file sources, like paths, buffers, streams, or plain text.\"]}, {\"level\": 3, \"title\": \"Client SDK\", \"body\": [\" Web The Appwrite Web SDK expects a File object for file creation. This is most commonly associated with DOM file inputs. For example, for the input tag , you would call create file like this: const promise = storage.createFile(\\n '[BUCKET_ID]',\\n ID.unique(),\\n document.getElementById('uploader').files[0]\\n); Flutter The Appwrite Flutter SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(path: [PATH], filename: [NAME], contentType: [MIME TYPE]) Used to upload files from a provided path, filename and contentType are optional. Used for Flutter apps on mobile and desktop. InputFile.fromBytes(bytes: [BYTE LIST], filename: [NAME], contentType: [MIME TYPE]) Used to upload files from a byte list, contentType is optional. Used for Flutter apps on web Android The Appwrite Android SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(path: String) Used to upload files from a provided path. InputFile.fromFile(file: File) Used to upload files from a File object. InputFile.fromBytes(bytes: ByteArray, filename: String, mimeType: String) Used to upload files from a ByteArray object. Specify the file MIME type using the mimeType param. Apple The Appwrite Apple SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(_ path: String) Used to upload files from a provided path. InputFile.fromData(_ data: Data, filename: String, mimeType: String) Used to upload files from a Data object. Specify the file MIME type using the mimeType param. InputFile.fromBuffer(_ buffer: ByteBuffer, filename: String, mimeType: String) Used to upload files from a NIO Buffer object. Specify the file MIME type using the mimeType param. \"]}, {\"level\": 3, \"title\": \"Server SDK\", \"body\": [\" Node.js The Appwrite NodeJS SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(filePath, filename) Used to upload files from a provided path. InputFile.fromBuffer(buffer, filename) Used to upload files from a Buffer object. InputFile.fromBlob(blob, filename) Used to upload files from a Blob object. InputFile.fromStream(stream, filename, size) Used to upload files from a Readable Stream object. InputFile.fromPlainText(content, filename) Used to upload files in plain text. Expects a string encoded in UTF-8. PHP The Appwrite PHP SDK expects an InputFile class for file inputs. Method Description InputFile.withPath(string $path, ?string $mimeType = null, ?string $filename = null) Used to upload files from a provided path. InputFile.withData(string $data, ?string $mimeType = null, ?string $filename = null) Used to upload files from a string. Python The Appwrite Python SDK expects an InputFile class for file inputs. Method Description InputFile.from_path(path) Used to upload files from a provided path. InputFile.from_bytes(bytes) Used to upload files from an array of bytes. Ruby The Appwrite Ruby SDK expects an InputFile class for file inputs. Method Description InputFile.from_path(path) Used to upload files from a provided path. InputFile.from_string(string) Used to upload files from a String. InputFile.from_bytes(bytes) Used to upload files from an array of bytes. Deno The Appwrite Deno SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(filePath, filename) Used to upload files from a provided path. InputFile.fromBuffer(buffer, filename) Used to upload files from a Uint8Array object. InputFile.fromPlainText(content, filename) Used to upload files in plain text. Expects a string encoded in UTF-8. Dart The Appwrite Dart SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(path: [PATH], filename: [NAME], contentType: [MIME TYPE]) Used to upload files from a provided path, filename and contentType are optional. InputFile.fromBytes(bytes: [BYTE LIST], filename: [NAME], contentType: [MIME TYPE]) Used to upload files from a byte list, contentType is optional. Kotlin The Appwrite Kotlin SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(path: String) Used to upload files from a provided path. InputFile.fromFile(file: File) Used to upload files from a File object. InputFile.fromBytes(bytes: ByteArray, filename: String, mimeType: String) Used to upload files from a ByteArray object. Specify the file MIME type using the mimeType param. Swift The Appwrite Swift SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(_ path: String) Used to upload files from a provided path. InputFile.fromData(_ data: Data, filename: String, mimeType: String) Used to upload files from a Data object. Specify the file MIME type using the mimeType param. InputFile.fromBuffer(_ buffer: ByteBuffer, filename: String, mimeType: String) Used to upload files from a NIO Buffer object. Specify the file MIME type using the mimeType param. .NET The Appwrite .NET SDK expects an InputFile class for file inputs. Method Description InputFile.FromPath(string path) Used to upload files from a provided path. InputFile.FromStream(Stream stream, string filename, string mimeType) Used to upload files from a Stream object. Specify the file MIME type using the mimeType param. InputFile.FromBytes(byte[] bytes, string filename, string mimeType) Used to upload files from an array of bytes. Specify the file MIME type using the mimeType param. \"]}, {\"level\": 2, \"title\": \"Image Manipulation\", \"body\": [\"Another great built-in feature of Appwrite is the image manipulation feature. With Appwrite Storage's preview endpoint you can manipulate resolution, add borders and the border-radius, add background-color, set the opacity for the image, and get the image in the appropriate output format.\", \"This enables a wide range of possibilities! You can manipulate images resolution to display appropriately on responsive websites. You can also adjust the image border, background color, and border-radius to match the theming of your application. The Appwrite Storage also allows you to change the format and compression of your images for network transfer optimization and to help you speed your application. You can do all that without caring about how the image was originally uploaded.\", \"Below you can find all the different parameters offered by the preview endpoint to manipulate the image.\", \" Parameter Description height Set the height of the output image in pixels, the image will be resized keeping the aspect ratio intact. Accepts integer between 0-4000 width Set the width of the output image in pixels, the image will be resized keeping the aspect ratio intact. Accepts integer between 0-4000 gravity The gravity while cropping the image providing either width, height or both. Accepts any of: center, top-left, top, top-right, left, right, bottom-left, bottom, bottom-right quality Set the quality of the output image. Accepts integer between 0-100, where 100 is the highest quality. borderWidth Set a border with given width in pixels to the output image. Accepts integer between 0-100 borderColor Set a border-color for the output image. Accepts any valid Hex color value without the leading #. borderRadius Set a border-radius in pixels. Accepts an integer between 0-4000. opacity Set opacity for the output image. Accepts a float value between 0-1, where 0 makes it transparent. Only works with output format supporting alpha channel like png. rotation Rotate the output image by a degree. Accepts an integer between -360 to 360. background Set a background-color. Accepts any valid Hex color value without the leading #. Only works with output format supporting alpha channel like png. output Set the output image format. If not provided, will use the original image's format. Supported formats are: jpg, jpeg, png, gif and webp \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/storage"}} \ No newline at end of file diff --git a/docs/4eec9918-4583-11ee-9922-f2ea36f81204.json b/docs/4eec9918-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..03cbbd8 --- /dev/null +++ b/docs/4eec9918-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Authentication \", \"body\": [\" Appwrite Authentication delivers more than just user sign up and log in. Authentication makes it easy to build secure and robust authentication with support for many different authentication methods.\", \" You can manage user accounts with user preferences, user labeling, or organizing users into teams. Combined with a robust permissions system, Appwrite Authentication provides everything you need to authenticate and manage users.\"]}, {\"level\": 2, \"title\": \"Getting Started\", \"body\": [\" Adding Appwrite Authentication to your apps can be as easy as these lines of code.\", \" Web import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst user = await account.create(\\n ID.unique(),\\n 'email@example.com',\\n 'password'\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.create(\\n userId: ID.unique(),\\n email: 'email@example.com',\\n password: 'password',\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.create(\\n userId = ID.unique(),\\n email = \\\"email@example.com\\\",\\n password = \\\"password\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet user = try await account.create(\\n userId: ID.unique(),\\n email: \\\"email@example.com\\\",\\n password: \\\"password\\\"\\n) GraphQL \\nmutation {\\n accountCreate(userId: \\\"unique()\\\", email: \\\"email@example.com\\\", password: \\\"password\\\") {\\n _id\\n email\\n name\\n }\\n} \", \" Use email and password authentication as a starting point and explore the many powerful features of Appwrite authentication.\"]}, {\"level\": 2, \"title\": \"Account vs Users API\", \"body\": [\" Appwrite has two auth APIs for different purposes, which are Account and Users. Here's how you choose between the two, depending on your needs.\"]}, {\"level\": 3, \"title\": \"Account API\", \"body\": [\" Use the Account API when acting on behalf of individual users when building client applications, like websites or mobile apps. The Account API is authenticated through secure cookies that store session information, so Appwrite knows which authenticated user is accessing data. The Account API is safe to expose to end users, because their access to data and resources is limited by Appwrite's permission system.\"]}, {\"level\": 3, \"title\": \"Users API\", \"body\": [\" Use the Users API when acting as an administrator in use cases like building admin consoles or server integrations. The Users API uses API keys to authenticate, which means Appwrite only knows which API key is accessing data. API keys don't respect permissions, which means they can access all data, and should never be shared with end users in client applications. The Users API also has batch operations, letting you query and manage users from an admin's perspective.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/authentication"}} \ No newline at end of file diff --git a/docs/4eeca03e-4583-11ee-9922-f2ea36f81204.json b/docs/4eeca03e-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..acb1f41 --- /dev/null +++ b/docs/4eeca03e-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Email and Password \", \"body\": [\" Email and password login is the most commonly used authentication method. Appwrite Authentication promotes a safer internet by providing secure APIs and promoting better password choices to end users. Appwrite supports added security features like blocking personal info in passwords, password dictionary, and password history to help users choose good passwords.\"]}, {\"level\": 2, \"title\": \"Sign Up\", \"body\": [\" You can use the Appwrite Client SDKs to create an account using email and password.\", \" Web import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.create('[USER_ID]', 'email@example.com', '');\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.create(\\n userId: ID.unique(),\\n email: 'email@example.com',\\n password: 'password',\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.create(\\n userId = ID.unique(),\\n email = \\\"email@example.com\\\",\\n password = \\\"password\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet user = try await account.create(\\n userId: ID.unique(),\\n email: \\\"email@example.com\\\",\\n password: \\\"password\\\"\\n) GraphQL \\nmutation {\\n accountCreate(userId: \\\"unique()\\\", email: \\\"email@example.com\\\", password: \\\"password\\\") {\\n _id\\n email\\n name\\n }\\n} \", \" Passwords are hashed with Argon2, a resilient and secure password hashing algorithm.\"]}, {\"level\": 2, \"title\": \"Verification\", \"body\": [\" After an account is created, it can be verified through the account create verification route. The user doesn't need to be verified to log in, but you can restrict resource access to verified users only using permissions through the user([USER_ID], \\\"verified\\\") role.\", \" First, send a verification email. Specify a redirect URL which users will be redirected to. The verification secrets will be appended as query parameters to the redirect URL. In this example, the redirect URL is https://example.com/verify.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client();\\n\\nconst account = new Account(client);\\n\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('5df5acd0d48c2') // Your project ID\\n;\\n\\nconst promise = account.createVerification('https://example.com');\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() { // Init SDK\\n Client client = Client();\\n Account account = Account(client);\\n\\n client\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('5df5acd0d48c2') // Your project ID\\n ;\\n Future result = account.createVerification(\\n url: 'https://example.com',\\n );\\n\\n result\\n .then((response) {\\n print(response);\\n }).catchError((error) {\\n print(error.response);\\n });\\n} Android import androidx.appcompat.app.AppCompatActivity\\nimport android.os.Bundle\\nimport kotlinx.coroutines.GlobalScope\\nimport kotlinx.coroutines.launch\\nimport io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nclass MainActivity : AppCompatActivity() {\\n override fun onCreate(savedInstanceState: Bundle?) {\\n super.onCreate(savedInstanceState)\\n setContentView(R.layout.activity_main)\\n\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"5df5acd0d48c2\\\") // Your project ID\\n\\n val account = Account(client)\\n\\n GlobalScope.launch {\\n val response = account.createVerification(\\n url = \\\"https://example.com\\\"\\n )\\n val json = response.body?.string() \\n }\\n }\\n} Apple import Appwrite\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"5df5acd0d48c2\\\") // Your project ID\\n let account = Account(client)\\n let token = try await account.createVerification(\\n url: \\\"https://example.com\\\"\\n )\\n\\n print(String(describing: token)\\n} GraphQL mutation {\\n accountCreateVerification(\\n url: \\\"https://example.com\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n secret\\n expire\\n }\\n} \", \" Next, implement the verification page in your app. This page will parse the secrets passed in through the userId and secret query parameters. In this example, the code below will be found in the page served at https://example.com/verify.\", \" Since the secrets are passed in through url params, it will be easiest to perform this step in the browser.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst urlParams = new URLSearchParams(window.location.search);\\nconst secret = urlParams.get('secret');\\nconst userId = urlParams.get('userId');\\n\\nconst promise = account.updateVerification(userId, secret);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() { // Init SDK\\n Client client = Client();\\n Account account = Account(client);\\n\\n client\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('5df5acd0d48c2') // Your project ID\\n ;\\n Future result = account.updateVerification(\\n userId: '[USER_ID]',\\n secret: '[SECRET]',\\n );\\n\\n result\\n .then((response) {\\n print(response);\\n }).catchError((error) {\\n print(error.response);\\n });\\n} Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"5df5acd0d48c2\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval response = account.updateVerification(\\n userId = \\\"[USER_ID]\\\",\\n secret = \\\"[SECRET]\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"5df5acd0d48c2\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet token = try await account.updateVerification(\\n userId: \\\"[USER_ID]\\\",\\n secret: \\\"[SECRET]\\\"\\n) GraphQL mutation {\\n accountUpdateVerification(\\n userId: \\\"[USER_ID]\\\",\\n secret: \\\"[SECRET]\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n secret\\n expire\\n }\\n} \"]}, {\"level\": 2, \"title\": \"Log In\", \"body\": [\" After you've created your account, users can be logged in using the Create Email Session route.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createEmailSession('email@example.com', 'password');\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal session = await account.createEmailSession(\\n email: 'email@example.com',\\n password: 'password'\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval session = account.createEmailSession(\\n email = \\\"email@example.com\\\",\\n password = \\\"password\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet session = try await account.createEmailSession(\\n email: \\\"email@example.com\\\",\\n password: \\\"password\\\"\\n) GraphQL mutation {\\n accountCreateEmailSession(email: \\\"email@example.com\\\", password: \\\"password\\\") {\\n _id\\n userId\\n provider\\n expire\\n }\\n} \"]}, {\"level\": 2, \"title\": \"Password Recovery\", \"body\": [\" If a user forgets their password, they can initiate a password recovery flow to recover their password. The Create Password Recovery endpoint sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link, they are redirected back to the password reset URL with the secret key and email address values attached to the URL as query strings. \", \" Only redirect URLs to domains added as a platform on your Appwrite console will be accepted. URLs not added as a platform are rejected to protect against redirect attacks.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst promise = account.createRecovery('email@example.com', 'https://example.com');\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = account.createRecovery(\\n email: 'email@example.com',\\n url: 'https://example.com',\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval response = account.createRecovery(\\n email = \\\"email@example.com\\\",\\n url = \\\"https://example.com\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet token = try await account.createRecovery(\\n email: \\\"email@example.com\\\",\\n url: \\\"https://example.com\\\"\\n) GraphQL mutation {\\n accountCreateRecovery(\\n email: \\\"email@example.com\\\",\\n url: \\\"https://example.com\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n secret\\n expire\\n }\\n} \", \"After receiving an email with the secret attached to the redirect link, submit a request to the Create Password Recovery (confirmation) endpoint to complete the recovery flow. The verification link sent to the user's email address is valid for 1 hour.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password');\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.updateRecovery(\\n userId: '[USER_ID]',\\n secret: '[SECRET]',\\n password: 'password'\\n passwordAgain: 'password'\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval token = account.updateRecovery(\\n userId = \\\"[USER_ID]\\\",\\n secret = \\\"[SECRET]\\\",\\n password = \\\"password\\\",\\n passwordAgain = \\\"password\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet token = try await account.updateRecovery(\\n userId: \\\"[USER_ID]\\\",\\n secret: \\\"[SECRET]\\\",\\n password: \\\"password\\\",\\n passwordAgain: \\\"password\\\"\\n) GraphQL mutation {\\n accountUpdateRecovery(\\n userId: \\\"[USER_ID]\\\",\\n secret: \\\"[SECRET]\\\",\\n password: \\\"password\\\",\\n passwordAgain: \\\"password\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n secret\\n expire\\n }\\n} \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/authentication-email-pass"}} \ No newline at end of file diff --git a/docs/4eecb164-4583-11ee-9922-f2ea36f81204.json b/docs/4eecb164-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..ce24c43 --- /dev/null +++ b/docs/4eecb164-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Phone (SMS) \", \"body\": [\" Phone authentication lets users create accounts using their phone numbers and log in through SMS messages.\"]}, {\"level\": 2, \"title\": \"Send SMS Message\", \"body\": [\" Phone authentication is done using a two-step authentication process. When using phone authentication, the authentication request is initiated from the client application and an SMS message is sent to the user's phone. The SMS message will contain a secret the user can use to log in.\", \" Send an SMS message to initiate the authentication process. A new account will be created for this phone number if it has never been used before.\", \" Web import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst sessionToken = await account.createPhoneSession(\\n ID.unique(),\\n '+14255550123'\\n);\\n\\nvar userId = sessionToken.userId; // Store this somewhere to use later when logging in Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal sessionToken = await account.createPhoneSession(\\n userId: ID.unique(),\\n phone: '+14255550123'\\n);\\n\\nfinal userId = sessionToken.userId; // Store this somewhere to use later when logging in Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval sessionToken = account.createPhoneSession(\\n userId = ID.unique(),\\n phone = \\\"+14255550123\\\"\\n)\\n\\nval userId = sessionToken.userId // Store this somewhere to use later when logging in Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet sessionToken = try await account.createPhoneSession(\\n userId: ID.unique(),\\n phone: \\\"+14255550123\\\"\\n)\\n\\nlet userId = sessionToken.userId // Store this somewhere to use later when logging in GraphQL mutation {\\n accountCreatePhoneSession(userId: \\\"unique()\\\", phone: \\\"+14255550123\\\") {\\n _id\\n userId\\n secret\\n expire\\n }\\n} \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/authentication-sms"}} \ No newline at end of file diff --git a/docs/4eecb844-4583-11ee-9922-f2ea36f81204.json b/docs/4eecb844-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..4d42fcd --- /dev/null +++ b/docs/4eecb844-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Magic URL \", \"body\": [\" Magic URL is a password-less way to authenticate users. When a user logs in by providing their email, they will receive an email with a \\\"magic\\\" link that contains a secret used to log in the user. The user can simply click the link to be logged in.\"]}, {\"level\": 2, \"title\": \"Send Email\", \"body\": [\" Initialize the log in process with the Create Magic URL Session route. If the email has never been used, a new account is generated, then the user will receive an email. If the email is already attached to an account, the user ID is ignored and the user will receive a link in their email.\", \" Web import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\n\\nconst promise = account.createMagicURLSession(ID.unique(), 'email@example.com');\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); GraphQL mutation {\\n accountCreateMagicURLSession(\\n userId: \\\"ID.unique()\\\",\\n email: \\\"email@example.com\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n secret\\n expire\\n }\\n} \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/authentication-magic"}} \ No newline at end of file diff --git a/docs/4eecbe70-4583-11ee-9922-f2ea36f81204.json b/docs/4eecbe70-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..bcc58d9 --- /dev/null +++ b/docs/4eecbe70-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" OAuth 2 \", \"body\": [\" OAuth authentication allows users to log in using accounts from other popular services. This can be convenient for users because they can start using your app without creating a new account. It can also be more secure, because the user has one less password that could become vulnerable.\", \" When using OAuth to authenticate, the authentication request is initiated from the client application. The user is then redirected to an OAuth 2 provider to complete the authentication step, and finally, the user is redirected back to the client application.\"]}, {\"level\": 2, \"title\": \"Configure OAuth 2 Login\", \"body\": [\" Before using OAuth 2 login, you need to enable and configure an OAuth 2 login provider.\", \" Navigate to your Appwrite project. Navigate to Auth > Settings. Find and open the OAuth provider. In the OAuth 2 settings modal, use the toggle to enable the provider. Create and OAuth 2 app on the provider's developer platform. Copy information from your OAuth2 provider's developer platform to fill the OAuth2 Settings modal in the Appwrite Console. Configure redirect URL in your OAuth 2 provider's developer platform. Set it to URL provided to you by OAuth2 Settings modal in Appwrite Console.\"]}, {\"level\": 2, \"title\": \"Initialize OAuth 2 Login\", \"body\": [\" To initialize the OAuth 2 login process, use the Create OAuth 2 Session route.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\n// Go to OAuth provider login page\\naccount.createOAuth2Session('amazon', [LINK_ON_SUCCESS], [LINK_ON_FAILURE]); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\n// Go to OAuth provider login page\\nawait account.createOAuth2Session(provider: 'amazon'); Android In order to capture the Appwrite OAuth callback url, the following activity needs to be added inside the tag, along side the existing tags in your AndroidManifest.xml. Be sure to replace the [PROJECT_ID] string with your actual Appwrite project ID. You can find your Appwrite project ID in your project settings screen in your Appwrite console. \\n ...\\n \\n ...\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\n// Go to OAuth provider login page\\naccount.createOAuth2Session(provider = \\\"amazon\\\") Apple In order to capture the Appwrite OAuth callback url, the following URL scheme needs to added to your Info.plist. CFBundleURLTypes\\n\\n\\n CFBundleTypeRole\\n Editor\\n CFBundleURLName\\n io.appwrite\\n CFBundleURLSchemes\\n \\n appwrite-callback-[PROJECT_ID]\\n \\n\\n\\nIf you're using UIKit, you'll also need to add a hook to your SceneDelegate.swift file to ensure cookies work correctly. \\nfunc scene(_ scene: UIScene, openURLContexts URLContexts: Set) {\\n guard let url = URLContexts.first?.url,\\n url.absoluteString.contains(\\\"appwrite-callback\\\") else {\\n return\\n }\\n WebAuthComponent.handleIncomingCookie(from: url)\\n}\\n import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\n// Go to OAuth provider login page\\ntry await account.createOAuth2Session(provider: \\\"amazon\\\") GraphQL OAuth 2 is not available through the GraphQL API. You can use the REST API or any Client SDK instead. \", \" You'll be redirected to the OAuth 2 provider's login page to log in. Once complete, your user will be redirected back to your app.\", \" You can optionally configure success or failure redirect links on web to handle success and failure scenarios.\"]}, {\"level\": 2, \"title\": \"OAuth 2 Profile\", \"body\": [\"After authenticating a user through their OAuth 2 provider, you can fetch their profile information such as their avatar image or name.\\nTo do this you can use the access token from the OAuth 2 provider and make API calls to the provider.\", \"After creating an OAuth 2 session, you can fetch the session to get information about the provider.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client();\\n\\nconst account = new Account(client);\\n\\nconst session = await account.getSession('current');\\n\\n// Provider information\\nconsole.log(session.provider);\\nconsole.log(session.providerUid);\\nconsole.log(session.providerAccessToken); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal session = await getSession(\\n sessionId : \\\"[SESSION_ID]\\\"\\n);\\n\\n// Provider information\\nprint(session.provider);\\nprint(session.providerUid);\\nprint(session.providerAccessToken); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"5df5acd0d48c2\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval response = account.getSession(\\n sessionId = \\\"[SESSION_ID]\\\"\\n)\\n\\n// Provider information\\nprint(session.provider);\\nprint(session.providerUid);\\nprint(session.providerAccessToken); Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"5df5acd0d48c2\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet session = try await account.getSession(\\n sessionId: \\\"[SESSION_ID]\\\"\\n)\\n\\n// Provider information\\nprint(session.provider);\\nprint(session.providerUid);\\nprint(session.providerAccessToken); \", \" An OAuth 2 session will have the following attributes.\", \" property Description provider The OAuth2 Provider. providerUid User ID from the OAuth 2 Provider. providerAccessToken Access token from the OAuth 2 provider. Use this to make requests to the OAuth 2 provider to fetch personal data. providerAccessTokenExpiry Check this value to know if an access token is about to expire. \", \" You can use the providerAccessToken to make requests to your OAuth 2 provider. Refer to the docs for the OAuth 2 provider you're using to learn about making API calls with the access token.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/authentication-oauth"}} \ No newline at end of file diff --git a/docs/4eecc654-4583-11ee-9922-f2ea36f81204.json b/docs/4eecc654-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..ee591c6 --- /dev/null +++ b/docs/4eecc654-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Anonymous \", \"body\": [\" Anonymous sessions allow you to implement guest users. Guest users let you store user information like items in their cart or theme preferences before they create an account. This reduces the friction for your users to get started with your app.\", \" If a user later creates an account, their information will be inherited by the newly created account.\"]}, {\"level\": 2, \"title\": \"Create Anonymous Session\", \"body\": [\" Create an anonymous session with Create Anonymous Session route.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createAnonymousSession();\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.createAnonymousSession(); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.createAnonymousSession() Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet user = try await account.createAnonymousSession() GraphQL \\nmutation {\\n accountCreateAnonymousSession {\\n _id\\n userId\\n provider\\n expire\\n }\\n} \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/authentication-anonymous"}} \ No newline at end of file diff --git a/docs/4eeccc94-4583-11ee-9922-f2ea36f81204.json b/docs/4eeccc94-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..3f19372 --- /dev/null +++ b/docs/4eeccc94-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" User Management \", \"body\": [\" Appwrite has built-in features to help manage user accounts. Users can be organized into teams and be given labels, so they can be given different permissions and access different resources. Each user can also have their own preference object, which you can use to save preferences such as theme, language, and notification settings.\"]}, {\"level\": 2, \"title\": \"User Preferences\", \"body\": [\" You can store user preferences on a user's account using Appwrite's Update Preferences endpoint. You can store user preferences such as theme, notification settings, or preferred language so they can be synced across multiple devices.\", \" Preferences are stored as a key-value JSON object. The maximum allowed size for preferences is 64kB, and an error will be thrown if this limit is exceeded.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.updatePrefs({darkTheme: true, language: 'en'});\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.updatePrefs(\\n prefs: {\\n \\\"darkTheme\\\": true,\\n \\\"language\\\": \\\"en\\\",\\n }\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.updatePrefs(\\n prefs = mapOf(\\\"darkTheme\\\" to true, \\\"language\\\" to \\\"en\\\")\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet user = try await account.updatePrefs(\\n prefs: [\\\"darkTheme\\\": true, \\\"language\\\": \\\"en\\\"]\\n) GraphQL mutation {\\n accountUpdatePrefs(\\n prefs: \\\"{\\\\\\\"darkTheme\\\\\\\": true, \\\\\\\"language\\\\\\\": \\\\\\\"en\\\\\\\"}\\\"\\n ) {\\n _id\\n name\\n prefs {\\n data\\n }\\n }\\n} \", \"After a user's preferences are updated, they can be retrieved using the Get Preferences endpoint.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.getPrefs();\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal prefs = await account.getPrefs(); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval prefs = account.getPrefs() Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet prefs = try await account.getPrefs() GraphQL query {\\n accountGetPrefs {\\n data\\n }\\n} \"]}, {\"level\": 2, \"title\": \"Users API\", \"body\": [\" The Users API is a dedicated API for managing users from an admin's perspective. You'll notice that the Account API doesn't allow you to view or make changes to other users. This is by design and for security reasons.\", \" You can use the Users API with an API key authenticated Server SDK to manage users. If you must expose parts of the Users API to normal users, we suggest doing so through an Appwrite Function. Exposing API keys to users is dangerous and a security risk, by using an Appwrite Function, you can add your own validation to prevent malicious behavior.\", \" Learn more about the Users API\"]}, {\"level\": 2, \"title\": \"Labels\", \"body\": [\" Labels are a good way to flag a user to grant them access to resources. For example, a subscriber label can be added to a user once they've purchased a subscription.\", \" Node.js const sdk = require('node-appwrite');\\n\\n// Init SDK\\nconst client = new sdk.Client();\\n\\nconst users = new sdk.Users(client);\\n\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('5df5acd0d48c2') // Your project ID\\n .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key\\n;\\n\\nconst promise = users.updateLabels('[USER_ID]', [ Role.label('subscriber') ]);\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); PHP use Appwrite\\\\Client;\\nuse Appwrite\\\\Services\\\\Users;\\nuse Appwrite\\\\Role;\\n\\n$client = new Client();\\n\\n$client\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('5df5acd0d48c2') // Your project ID\\n .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key\\n;\\n\\n$users = new Users($client);\\n\\n$result = $users->updateLabels(\\n '[USER_ID]', \\n [\\n Role.label('subscriber'),\\n ]\\n); Python from appwrite.client import Client\\nfrom appwrite.services.users import Users\\nfrom appwrite.role import Role\\n\\nclient = Client()\\n\\n(client\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('5df5acd0d48c2') # Your project ID\\n .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key\\n)\\n \\nusers = Users(client)\\n\\nresult = users.update_labels('[USER_ID]', [ Role.label('subscriber') ]) Ruby require 'Appwrite'\\n\\ninclude Appwrite\\n\\nclient = Client.new\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('5df5acd0d48c2') # Your project ID\\n .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key\\n\\nusers = Users.new(client)\\n\\nresponse = users.update_labels(user_id: '[USER_ID]', labels: [ Role.label('subscriber') ])\\n\\nputs response.inspect Deno import * as sdk from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n\\n// Init SDK\\nlet client = new sdk.Client();\\n\\nlet users = new sdk.Users(client);\\n\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('5df5acd0d48c2') // Your project ID\\n .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key\\n;\\n\\n\\nconst promise = users.updateLabels('[USER_ID]', [ Role.label('subscriber') ]);\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); Dart import 'package:dart_appwrite/dart_appwrite.dart';\\n\\nvoid main() { // Init SDK\\n Client client = Client();\\n Users users = Users(client);\\n\\n client\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('5df5acd0d48c2') // Your project ID\\n .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key\\n ;\\n\\n Future result = users.updateLabels(\\n userId: '[USER_ID]',\\n labels: [ Role.label('subscriber') ],\\n );\\n\\n result\\n .then((response) {\\n print(response);\\n }).catchError((error) {\\n print(error.response);\\n });\\n} Kotlin import io.appwrite.Client\\nimport io.appwrite.services.Users\\nimport io.appwrite.Role\\n\\nsuspend fun main() {\\n val client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"5df5acd0d48c2\\\") // Your project ID\\n .setKey(\\\"919c2d18fb5d4...a2ae413da83346ad2\\\") // Your secret API key\\n\\n val users = Users(client)\\n val response = users.updateLabels(\\n userId = \\\"[USER_ID]\\\",\\n labels = [ Role.label('subscriber') ]\\n )\\n val json = response.body?.string()\\n} Swift import Appwrite\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"5df5acd0d48c2\\\") // Your project ID\\n .setKey(\\\"919c2d18fb5d4...a2ae413da83346ad2\\\") // Your secret API key\\n let users = Users(client)\\n let response = try await users.updateLabels(\\n userId: \\\"[USER_ID]\\\",\\n labels: [ Role.label('subscriber') ]\\n )\\n\\n print(String(describing: response)\\n} .NET \", \" This would correspond with the permissions Permissions.read(Role.label('subscriber')), Permissions.update(Role.label('subscriber')), Permissions.delete(Role.label('subscriber')), and Permissions.create(Role.label('subscriber')).\", \" Learn more about permissions\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/authentication-management"}} \ No newline at end of file diff --git a/docs/4eecd93c-4583-11ee-9922-f2ea36f81204.json b/docs/4eecd93c-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..e0836ae --- /dev/null +++ b/docs/4eecd93c-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Client to Server Auth \", \"body\": [\" You can extend Appwrite's APIs by building backend apps using Server SDKs. To secure your backend app's APIs, client apps must prove their identity against your backend app before accessing sensitive information. You can secure these APIs and enforce access permissions in your backend app by using JWT authentication.\", \" If you are already authenticated on your client-side app and need your backend app to act on behalf of the user, this guide will walk you through the process.\"]}, {\"level\": 2, \"title\": \"Proof of Identity\", \"body\": [\"Before making requests to your backend APIs, your client application needs to first create a session directly with Appwrite using the account service. This session will act like an ID card for the user and can be used to access resources in Appwrite. The client will only receive information accessible to the user based on the resources' permissions.\", \"When you build backend APIs to extend Appwrite's functionality, these APIs should still respect access permissions to keep user data secure. Appwrite's backend SDKs allows you to securely act on behalf of a user with the same permissions by using JWT authentication.\"]}, {\"level\": 2, \"title\": \"JWT Authentication\", \"body\": [\"JSON Web Tokens (JWTs) are a secure means to transfer information or claims between two parties. JWTs act like temporary copies of the user's ID card that allow Appwrite's Server SDKs to access information on behalf of a user.\", \"You need to create a session using the Client SDKs before generating a JWT. The JWT will be a stateless proof of claim for the identity of the authenticated user and expire after 15 minutes or when the session is deleted.\", \"You can generate a JWT like this:\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst user = await account.createJWT(); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal jwt = await account.createJWT();\\n\\n Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval jwt = account.createJWT() Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet jwt = try await account.createJWT() GraphQL mutation {\\n accountCreateJWT {\\n jwt\\n }\\n} \", \"Your server application can use the JWT to act on behalf of the user by creating a Client instance with the JWT for each request it receives. To keep your API secure, discard the client object after each request.\", \" Node.js const { Client } = require('node-appwrite');\\n\\nconst client = new Client();\\n\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setJWT('eyJJ9.eyJ...886ca'); // Your secret JSON Web Token PHP use Appwrite\\\\Client;\\n\\n$client = new Client();\\n\\n$client\\n ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n ->setProject('[PROJECT_ID]') // Your project ID\\n ->setJWT('eyJJ9.eyJ...886ca'); // Your secret JSON Web Token Python from appwrite.client import Client\\n\\nclient = Client()\\n\\n(client\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_jwt('eyJJ9.eyJ...886ca') # Your secret JSON Web Token\\n) Ruby require 'appwrite'\\n\\ninclude Appwrite\\n\\nclient = Client.new\\n\\nclient\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_jwt('eyJJ9.eyJ...886ca') # Your secret JSON Web Token Deno import { Client } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n\\nlet client = new Client();\\n\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setJWT('eyJJ9.eyJ...886ca'); // Your secret JSON Web Token Dart import 'package:dart_appwrite/dart_appwrite.dart';\\n\\nfinal client = Client();\\n\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setJWT('eyJJ9.eyJ...886ca'); // Your secret JSON Web Token Kotlin import io.appwrite.Client\\n\\nval client = Client()\\n\\nclient\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setJWT(\\\"eyJJ9.eyJ...886ca\\\") // Your secret JSON Web Token Swift import Appwrite\\n\\nlet client = Client()\\n\\nclient\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setJWT(\\\"eyJJ9.eyJ...886ca\\\") // Your secret JSON Web Token .NET using Appwrite;\\n\\nvar client = new Client();\\n\\nclient\\n .SetEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .SetProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .SetJWT(\\\"eyJJ9.eyJ...886ca\\\"); // Your secret JSON Web Token \"]}, {\"level\": 2, \"title\": \"When Should I Use JWT Auth?\", \"body\": [\"JWT auth is useful when you need your backend app's Server SDK to be restricted by the same set of permissions.\", \"If your backend app's Server SDK is using an API key, it will fetch all resources regardless of permissions. This means the Server SDK might fetch files and documents your user should not be able to see, which is not helpful when you need to act on behalf of a user.\", \"If your backend app's Server SDK is using a JWT, it will only fetch resources your user has permissions to access.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/authentication-server"}} \ No newline at end of file diff --git a/docs/4eece094-4583-11ee-9922-f2ea36f81204.json b/docs/4eece094-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..7783e73 --- /dev/null +++ b/docs/4eece094-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Security \", \"body\": [\" Appwrite provides many security features to keep both your Appwrite project and your user's information secure.\"]}, {\"level\": 2, \"title\": \"Persistence\", \"body\": [\" Appwrite handles the persistence of the session in a consistent way across SDKs. After authenticating with an SDK, the SDK will persist the session so that the user will not need to log in again the next time they open the app. The mechanism for persistence depends on the SDK.\", \" Best Practice Only keep user sessions active as long as needed and maintain exactly one instance of the Client SDK in your app to avoid conflicting session data.\", \" SDK Persistence Method Web Uses a secure session cookie and falls back to local storage when a session cookie is not available. Flutter Uses a session cookie stored in Application Documents through the path_provider package. Apple Uses a session cookie stored in UserDefaults. Android Uses a session cookie stored in SharedPreferences. \"]}, {\"level\": 2, \"title\": \"Session Limits\", \"body\": [\"In Appwrite versions 1.2 and above, you can limit the number of active sessions created per user to prevent the accumulation of unused but active sessions. New sessions created by the same user past the session limit delete the oldest session.\", \"You can change the session limit in the Security tab of the Auth Service in your Appwrite Console. The default session limit is 10 with a maximum configurable limit of 100.\"]}, {\"level\": 2, \"title\": \"Permissions\", \"body\": [\" Security is very important to protect users' data and privacy. Appwrite uses a permissions model coupled with user sessions to ensure users need correct permissions to access resources. With all Appwrite services, including databases and storage, access is granted at the collection, bucket, document, or file level. These permissions are enforced for client SDKs and server SDKs when using JWT, but are ignored when using a server SDK with an API key.\"]}, {\"level\": 2, \"title\": \"Password History\", \"body\": [\"Password history prevents users from reusing recent passwords. This protects user accounts from security risks by enforcing a new password every time it's changed.\", \"Password history can be enabled in the Auth service's Security tab on the Appwrite Console. You can choose how many previous passwords to remember up to a maximum of 20 and block users from reusing them.\"]}, {\"level\": 2, \"title\": \"Password Dictionary\", \"body\": [\"Password dictionary protects users from using bad passwords. It compares the user's password to the 10,000 most common passwords and throws an error if there's a match. Together with rate limits, password dictionary will significantly reduce the chance of a malicious actor from guessing user passwords.\", \"Password dictionary can be enabled in the Auth service's Security tab on the Appwrite Console.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/authentication-security"}} \ No newline at end of file diff --git a/docs/4eecea6c-4583-11ee-9922-f2ea36f81204.json b/docs/4eecea6c-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..d4f64a1 --- /dev/null +++ b/docs/4eecea6c-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Functions \", \"body\": [\" Appwrite Functions unlock limitless potential for developers to extend Appwrite with code snippets. Appwrite Functions are user-defined functions that can start small and scale big, deploying automatically from source control. These Functions can be triggered by HTTP requests, SDK methods, server events, webhooks, and scheduled executions. Each function will have its own URL, execute in its own isolated container, and have its own configurable environment variables and permissions.\"]}, {\"level\": 2, \"title\": \"Getting Started\", \"body\": [\" Appwrite Functions let you build anything you can imagine, but this flexibility makes it difficult to know where to start. Start exploring by cloning one of the quick start templates or using a template with pre-built integration to quickly implement features.\", \" \\\"Create Function\\\" page. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/functions"}} \ No newline at end of file diff --git a/docs/4eecf002-4583-11ee-9922-f2ea36f81204.json b/docs/4eecf002-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..c83c518 --- /dev/null +++ b/docs/4eecf002-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Development \", \"body\": [\" Appwrite Functions offer a familiar interface if you've developed REST endpoints. Each function is handled following a request and response pattern.\"]}, {\"level\": 2, \"title\": \"Lifecycle\", \"body\": [\" There is a clear lifecycle for all Appwrite Functions, from beginning to end. Here's everything that happens during a function execution.\", \" The function is invoked. Appwrite passes in request information like headers, body or path through the context.req object. The runtime executes the code you defined, you can log through the context.log() or context.error() methods. Function terminates when you return results using return context.res.send(), return context.res.json() or similar.\", \"You'll find all of these steps in a simple function like this.\", \" Node.js import { Client } from 'node-appwrite';\\n\\n// This is your Appwrite function\\n// It's executed each time we get a request\\nexport default async ({ req, res, log, error }) => {\\n // Why not try the Appwrite SDK?\\n //\\n // const client = new Client()\\n // .setEndpoint('https://cloud.appwrite.io/v1')\\n // .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)\\n // .setKey(process.env.APPWRITE_API_KEY);\\n\\n // You can log messages to the console\\n log('Hello, Logs!');\\n\\n // If something goes wrong, log an error\\n error('Hello, Errors!');\\n\\n // The `req` object contains the request data\\n if (req.method === 'GET') {\\n // Send a response with the res object helpers\\n // `res.send()` dispatches a string back to the client\\n return res.send('Hello, World!');\\n }\\n\\n // `res.json()` is a handy helper for sending JSON\\n return res.json({\\n motto: 'Build Fast. Scale Big. All in One Place.',\\n learn: 'https://appwrite.io/docs',\\n connect: 'https://appwrite.io/discord',\\n getInspired: 'https://builtwith.appwrite.io',\\n });\\n}; PHP require(__DIR__ . '/../vendor/autoload.php');\\n\\nuse Appwrite\\\\Client;\\nuse Appwrite\\\\Exception;\\n\\n// This is your Appwrite function\\n// It's executed each time we get a request\\nreturn function ($context) {\\n // Why not try the Appwrite SDK?\\n //\\n // $client = new Client();\\n // $client\\n // ->setEndpoint('https://cloud.appwrite.io/v1')\\n // ->setProject(getenv('APPWRITE_FUNCTION_PROJECT_ID'))\\n // ->setKey(getenv('APPWRITE_API_KEY'));\\n\\n // You can log messages to the console\\n $context->log('Hello, Logs!');\\n\\n // If something goes wrong, log an error\\n $context->error('Hello, Errors!');\\n\\n // The `req` object contains the request data\\n if ($context->req->method === 'GET') {\\n // Send a response with the res object helpers\\n // `res.send()` dispatches a string back to the client\\n return $context->res->send('Hello, World!');\\n }\\n\\n // `res.json()` is a handy helper for sending JSON\\n return $context->res->json([\\n 'motto' => 'Build Fast. Scale Big. All in One Place.',\\n 'learn' => 'https://appwrite.io/docs',\\n 'connect' => 'https://appwrite.io/discord',\\n 'getInspired' => 'https://builtwith.appwrite.io',\\n ]);\\n}; Python from appwrite.client import Client\\nimport os\\n\\n\\n# This is your Appwrite function\\n# It's executed each time we get a request\\ndef main(context):\\n # Why not try the Appwrite SDK?\\n #\\n # client = (\\n # Client()\\n # .set_endpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n # .set_project(os.environ[\\\"APPWRITE_FUNCTION_PROJECT_ID\\\"])\\n # .set_key(os.environ[\\\"APPWRITE_API_KEY\\\"])\\n # )\\n\\n # You can log messages to the console\\n context.log(\\\"Hello, Logs!\\\")\\n\\n # If something goes wrong, log an error\\n context.error(\\\"Hello, Errors!\\\")\\n\\n # The `ctx.req` object contains the request data\\n if context.req.method == \\\"GET\\\":\\n # Send a response with the res object helpers\\n # `ctx.res.send()` dispatches a string back to the client\\n return context.res.send(\\\"Hello, World!\\\")\\n\\n # `ctx.res.json()` is a handy helper for sending JSON\\n return context.res.json(\\n {\\n \\\"motto\\\": \\\"Build Fast. Scale Big. All in One Place.\\\",\\n \\\"learn\\\": \\\"https://appwrite.io/docs\\\",\\n \\\"connect\\\": \\\"https://appwrite.io/discord\\\",\\n \\\"getInspired\\\": \\\"https://builtwith.appwrite.io\\\",\\n }\\n ) Ruby require \\\"appwrite\\\"\\n\\n# This is your Appwrite function\\n# It's executed each time we get a request\\ndef main(context)\\n # Why not try the Appwrite SDK?\\n #\\n # client = Appwrite::Client.new\\n # client\\n # .set_endpoint('https://cloud.appwrite.io/v1')\\n # .set_project(ENV['APPWRITE_FUNCTION_PROJECT_ID'])\\n # .set_key(ENV['APPWRITE_API_KEY'])\\n\\n # You can log messages to the console\\n context.log(\\\"Hello, Logs!\\\")\\n\\n # If something goes wrong, log an error\\n context.error(\\\"Hello, Errors!\\\")\\n\\n # The `ctx.req` object contains the request data\\n if (context.req.method == \\\"GET\\\")\\n # Send a response with the res object helpers\\n # `ctx.res.send()` dispatches a string back to the client\\n return context.res.send(\\\"Hello, World!\\\")\\n end\\n\\n # `ctx.res.json()` is a handy helper for sending JSON\\n return context.res.json(\\n {\\n \\\"motto\\\": \\\"Build Fast. Scale Big. All in One Place.\\\",\\n \\\"learn\\\": \\\"https://appwrite.io/docs\\\",\\n \\\"connect\\\": \\\"https://appwrite.io/discord\\\",\\n \\\"getInspired\\\": \\\"https://builtwith.appwrite.io\\\",\\n }\\n )\\nend Deno import { Client } from \\\"https://deno.land/x/appwrite@7.0.0/mod.ts\\\";\\n\\n// This is your Appwrite function\\n// It's executed each time we get a request\\nexport default ({ req, res, log, error }: any) => {\\n // Why not try the Appwrite SDK?\\n //\\n // const client = new Client()\\n // .setEndpoint('https://cloud.appwrite.io/v1')\\n // .setProject(Deno.env.get(\\\"APPWRITE_FUNCTION_PROJECT_ID\\\"))\\n // .setKey(Deno.env.get(\\\"APPWRITE_API_KEY\\\"));\\n\\n // You can log messages to the console\\n log(\\\"Hello, Logs!\\\");\\n\\n // If something goes wrong, log an error\\n error(\\\"Hello, Errors!\\\");\\n\\n // The `req` object contains the request data\\n if (req.method === \\\"GET\\\") {\\n // Send a response with the res object helpers\\n // `res.send()` dispatches a string back to the client\\n return res.send(\\\"Hello, World!\\\");\\n }\\n\\n // `res.json()` is a handy helper for sending JSON\\n return res.json({\\n motto: \\\"Build Fast. Scale Big. All in One Place.\\\",\\n learn: \\\"https://appwrite.io/docs\\\",\\n connect: \\\"https://appwrite.io/discord\\\",\\n getInspired: \\\"https://builtwith.appwrite.io\\\",\\n });\\n}; Dart import 'dart:async';\\nimport 'package:dart_appwrite/dart_appwrite.dart';\\n\\n// This is your Appwrite function\\n// It's executed each time we get a request\\nFuture main(final context) async {\\n// Why not try the Appwrite SDK?\\n //\\n // final client = Client()\\n // .setEndpoint('https://cloud.appwrite.io/v1')\\n // .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)\\n // .setKey(process.env.APPWRITE_API_KEY);\\n\\n // You can log messages to the console\\n context.log('Hello, Logs!');\\n\\n // If something goes wrong, log an error\\n context.error('Hello, Errors!');\\n\\n // The `req` object contains the request data\\n if (context.req.method == 'GET') {\\n // Send a response with the res object helpers\\n // `res.send()` dispatches a string back to the client\\n return context.res.send('Hello, World!');\\n }\\n\\n // `res.json()` is a handy helper for sending JSON\\n return context.res.json({\\n 'motto': 'Build Fast. Scale Big. All in One Place.',\\n 'learn': 'https://appwrite.io/docs',\\n 'connect': 'https://appwrite.io/discord',\\n 'getInspired': 'https://builtwith.appwrite.io',\\n });\\n} Swift import Appwrite\\nimport AppwriteModels\\nimport Foundation\\n\\n// This is your Appwrite function\\n// It's executed each time we get a request\\nfunc main(context: RuntimeContext) async throws -> RuntimeOutput {\\n // Why not try the Appwrite SDK?\\n //\\n // let client = Client()\\n // .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n // .setProject(ProcessInfo.processInfo.environment[\\\"APPWRITE_FUNCTION_PROJECT_ID\\\"])\\n // .setKey(ProcessInfo.processInfo.environment[\\\"APPWRITE_API_KEY\\\"]);\\n\\n // You can log messages to the console\\n context.log(\\\"Hello, Logs!\\\")\\n\\n // If something goes wrong, log an error\\n context.error(\\\"Hello, Errors!\\\")\\n\\n // The `context.req` object contains the request data\\n if context.req.method == \\\"GET\\\" {\\n // Send a response with the res object helpers\\n // `res.send()` dispatches a string back to the client\\n return try context.res.send(\\\"Hello, World!\\\")\\n }\\n\\n // `context.res.json()` is a handy helper for sending JSON\\n return try context.res.json([\\n \\\"motto\\\": \\\"Build Fast. Scale Big. All in One Place.\\\",\\n \\\"learn\\\": \\\"https://appwrite.io/docs\\\",\\n \\\"connect\\\": \\\"https://appwrite.io/discord\\\",\\n \\\"getInspired\\\": \\\"https://builtwith.appwrite.io\\\",\\n ])\\n} .NET namespace DotNetRuntime;\\n\\nusing Appwrite;\\nusing Appwrite.Services;\\nusing Appwrite.Models;\\n\\npublic class Handler {\\n\\n // This is your Appwrite function\\n // It\\\"s executed each time we get a request\\n public async Task Main(RuntimeContext Context) \\n {\\n // Why not try the Appwrite SDK?\\n //\\n // var client = new Client()\\n // .SetEndpoint(\\\"http://cloud.appwrite.io/v1\\\") \\n // .SetProject(Environment.GetEnvironmentVariable(\\\"APPWRITE_FUNCTION_PROJECT_ID\\\")) \\n // .SetKey(Environment.GetEnvironmentVariable(\\\"APPWRITE_API_KEY\\\"))\\n\\n // You can log messages to the console\\n Context.Log(\\\"Hello, Logs!\\\");\\n\\n // If something goes wrong, log an error\\n Context.Error(\\\"Hello, Errors!\\\");\\n\\n // The `Context.Req` object contains the request data\\n if (Context.Req.Method == \\\"GET\\\") {\\n // Send a response with the res object helpers\\n // `Context.Res.Send()` dispatches a string back to the client\\n return Context.Res.Send(\\\"Hello, World!\\\");\\n }\\n\\n // `Context.Res.Json()` is a handy helper for sending JSON\\n return Context.Res.Json(new Dictionary()\\n {\\n { \\\"motto\\\", \\\"Build Fast. Scale Big. All in One Place.\\\" },\\n { \\\"learn\\\", \\\"https://appwrite.io/docs\\\" },\\n { \\\"connect\\\", \\\"https://appwrite.io/discord\\\" },\\n { \\\"getInspired\\\", \\\"https://builtwith.appwrite.io\\\" },\\n });\\n }\\n} Kotlin package io.openruntimes.kotlin.src\\n\\nimport io.openruntimes.kotlin.RuntimeContext\\nimport io.openruntimes.kotlin.RuntimeOutput\\nimport io.appwrite.Client\\nimport java.util.HashMap\\n\\nclass Main {\\n // This is your Appwrite function\\n // It's executed each time we get a request\\n fun main(context: RuntimeContext): RuntimeOutput {\\n // Why not try the Appwrite SDK?\\n // val client = Client().apply {\\n // setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n // setProject(System.getenv(\\\"APPWRITE_FUNCTION_PROJECT_ID\\\"))\\n // setKey(System.getenv(\\\"APPWRITE_API_KEY\\\"))\\n // }\\n\\n // You can log messages to the console\\n context.log(\\\"Hello, Logs!\\\")\\n\\n // If something goes wrong, log an error\\n context.error(\\\"Hello, Errors!\\\")\\n\\n // The `context.req` object contains the request data\\n if (context.req.method == \\\"GET\\\") {\\n // Send a response with the res object helpers\\n // `context.res.send()` dispatches a string back to the client\\n return context.res.send(\\\"Hello, World!\\\")\\n }\\n\\n // `context.res.json()` is a handy helper for sending JSON\\n return context.res.json(mutableMapOf(\\n \\\"motto\\\" to \\\"Build Fast. Scale Big. All in One Place.\\\",\\n \\\"learn\\\" to \\\"https://appwrite.io/docs\\\",\\n \\\"connect\\\" to \\\"https://appwrite.io/discord\\\",\\n \\\"getInspired\\\" to \\\"https://builtwith.appwrite.io\\\"\\n ))\\n }\\n} Java package io.openruntimes.java.src;\\n\\nimport io.openruntimes.java.RuntimeContext;\\nimport io.openruntimes.java.RuntimeOutput;\\nimport java.util.HashMap;\\nimport io.appwrite.Client;\\n\\npublic class Main {\\n\\n // This is your Appwrite function\\n // It's executed each time we get a request\\n public RuntimeOutput main(RuntimeContext context) throws Exception {\\n // Why not try the Appwrite SDK?\\n //\\n // Client client = new Client();\\n // client\\n // .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n // .setProject(System.getenv(\\\"APPWRITE_FUNCTION_PROJECT_ID\\\"))\\n // .setKey(System.getenv(\\\"APPWRITE_API_KEY\\\"));\\n\\n // You can log messages to the console\\n context.log(\\\"Hello, Logs!\\\");\\n\\n // If something goes wrong, log an error\\n context.error(\\\"Hello, Errors!\\\");\\n\\n // The `context.getReq()` object contains the request data\\n if (context.getReq().getMethod().equals(\\\"GET\\\")) {\\n // Send a response with the res object helpers\\n // `context.getRes().send()` dispatches a string back to the client\\n return context.getRes().send(\\\"Hello, World!\\\");\\n }\\n\\n Map json = new HashMap<>();\\n json.put(\\\"motto\\\", \\\"Build Fast. Scale Big. All in One Place.\\\");\\n json.put(\\\"learn\\\", \\\"https://appwrite.io/docs\\\");\\n json.put(\\\"connect\\\", \\\"https://appwrite.io/discord\\\");\\n json.put(\\\"getInspired\\\", \\\"https://builtwith.appwrite.io\\\");\\n \\n // `context.getRes().json()` is a handy helper for sending JSON\\n return context.getRes().json(json);\\n }\\n} \", \"If you prefer to learn through more examples like this, explore the examples page.\"]}, {\"level\": 2, \"title\": \"The Context Object\", \"body\": [\" Context is an object passed into every function to handle communication to both the end users, and logging to the Appwrite Console. All input, output, and logging must be handled through the context object passed in.\", \"You'll find these properties in the context object.\", \" Property Description req Contains request information like method, body, and headers. See full examples here. res Contains methods to build a response and return information. See full examples here. log() Method to log information to the Appwrite Console, end users will not be able to see these logs. See full examples here. error() Methoc to log errors to the Appwrite Console, end users will not be able to see these errors. See full examples here. \"]}, {\"level\": 3, \"title\": \"Destructuring Assignment\", \"body\": [\" Some languages, namely JavaScript, support destructuring. You'll see us use destructing in examples, which has the following syntax. Learn more about destructuring assignment.\", \" Node.js // before destructuring\\nexport default async function (context) {\\n context.log(\\\"This is a log!\\\");\\n // ... more code\\n}\\n\\n// after destructuring\\nexport default async function ({ req, res, log, error }) {\\n log(\\\"This is a log!\\\");\\n // ... more code\\n} Deno // before destructuring\\nexport default async function (context: any) {\\n context.log(\\\"This is a log!\\\");\\n // ... more code\\n}\\n \\n// after destructuring\\nexport default async function ({ req, res, log, error }: any) {\\n context.log(\\\"This is a log!\\\");\\n // ... more code\\n} \"]}, {\"level\": 3, \"title\": \"Request\", \"body\": [\" If you pass data into an Appwrite Function, it'll be found in the request object. This includes all invocation inputs from Appwrite SDKs, HTTP calls, Appwrite events, or browsers visiting the configured domain. Explore the request object with the following function, which logs all request params to the Appwrite Console.\", \" Node.js export default async ({ req, res, log }) => {\\n log(req.bodyRaw); // Raw request body, contains request data\\n log(JSON.stringify(req.body)); // Object from parsed JSON request body, otherwise string\\n log(JSON.stringify(req.headers)); // String key-value pairs of all request headers, keys are lowercase\\n log(req.scheme); // Value of the x-forwarded-proto header, usually http or https\\n log(req.method); // Request method, such as GET, POST, PUT, DELETE, PATCH, etc.\\n log(req.url); // Full URL, for example: http://awesome.appwrite.io:8000/v1/hooks?limit=12&offset=50\\n log(req.host); // Hostname from the host header, such as awesome.appwrite.io\\n log(req.port); // Port from the host header, for example 8000\\n log(req.path); // Path part of URL, for example /v1/hooks\\n log(req.queryString); // Raw query params string. For example \\\"limit=12&offset=50\\\"\\n log(JSON.stringify(req.query)); // Parsed query params. For example, req.query.limit\\n\\n return res.send(\\\"All the request parameters are logged to the Appwrite Console.\\\");\\n}; PHP log($context->req->bodyRaw); // Raw request body, contains request data\\n $context->log(json_encode($context->req->body)); // Object from parsed JSON request body, otherwise string\\n $context->log(json_encode($context->req->headers)); // String key-value pairs of all request headers, keys are lowercase\\n $context->log($context->req->scheme); // Value of the x-forwarded-proto header, usually http or https\\n $context->log($context->req->method); // Request method, such as GET, POST, PUT, DELETE, PATCH, etc.\\n $context->log($context->req->url); // Full URL, for example: http://awesome.appwrite.io:8000/v1/hooks?limit=12&offset=50\\n $context->log($context->req->host); // Hostname from the host header, such as awesome.appwrite.io\\n $context->log($context->req->port); // Port from the host header, for example 8000\\n $context->log($context->req->path); // Path part of URL, for example /v1/hooks\\n $context->log($context->req->queryString); // Raw query params string. For example \\\"limit=12&offset=50\\\"\\n $context->log(json_encode($context->req->query)); // Parsed query params. For example, req.query.limit\\n\\n return $context->res->send(\\\"All the request parameters are logged to the Appwrite Console.\\\");\\n} Python import json\\n\\ndef main(context):\\n context.log(context.req.bodyRaw) # Raw request body, contains request data\\n context.log(json.dumps(context.req.body)) # Object from parsed JSON request body, otherwise string\\n context.log(json.dumps(context.req.headers)) # String key-value pairs of all request headers, keys are lowercase\\n context.log(context.req.scheme) # Value of the x-forwarded-proto header, usually http or https\\n context.log(context.req.method) # Request method, such as GET, POST, PUT, DELETE, PATCH, etc.\\n context.log(context.req.url) # Full URL, for example: http://awesome.appwrite.io:8000/v1/hooks?limit=12&offset=50\\n context.log(context.req.host) # Hostname from the host header, such as awesome.appwrite.io\\n context.log(context.req.port) # Port from the host header, for example 8000\\n context.log(context.req.path) # Path part of URL, for example /v1/hooks\\n context.log(context.req.queryString) # Raw query params string. For example \\\"limit=12&offset=50\\\"\\n context.log(json.dumps(context.req.query)) # Parsed query params. For example, req.query.limit\\n\\n return context.res.send(\\\"All the request parameters are logged to the Appwrite Console.\\\") Ruby require 'json'\\n \\ndef main(context)\\n context.log(context.req.bodyRaw) # Raw request body, contains request data\\n context.log(JSON.generate(context.req.body)) # Object from parsed JSON request body, otherwise string\\n context.log(JSON.generate(context.req.headers)) # String key-value pairs of all request headers, keys are lowercase\\n context.log(context.req.scheme) # Value of the x-forwarded-proto header, usually http or https\\n context.log(context.req.method) # Request method, such as GET, POST, PUT, DELETE, PATCH, etc.\\n context.log(context.req.url) # Full URL, for example: http://awesome.appwrite.io:8000/v1/hooks?limit=12&offset=50\\n context.log(context.req.host) # Hostname from the host header, such as awesome.appwrite.io\\n context.log(context.req.port) # Port from the host header, for example 8000\\n context.log(context.req.path) # Path part of URL, for example /v1/hooks\\n context.log(context.req.queryString) # Raw query params string. For example \\\"limit=12&offset=50\\\"\\n context.log(JSON.generate(context.req.query)) # Parsed query params. For example, req.query.limit\\n\\n return context.res.send(\\\"All the request parameters are logged to the Appwrite Console.\\\")\\nend Deno export default async ({ req, res, log }: any) => {\\n log(req.bodyRaw); // Raw request body, contains request data\\n log(JSON.stringify(req.body)); // Object from parsed JSON request body, otherwise string\\n log(JSON.stringify(req.headers)); // String key-value pairs of all request headers, keys are lowercase\\n log(req.scheme); // Value of the x-forwarded-proto header, usually http or https\\n log(req.method); // Request method, such as GET, POST, PUT, DELETE, PATCH, etc.\\n log(req.url); // Full URL, for example: http://awesome.appwrite.io:8000/v1/hooks?limit=12&offset=50\\n log(req.host); // Hostname from the host header, such as awesome.appwrite.io\\n log(req.port); // Port from the host header, for example 8000\\n log(req.path); // Path part of URL, for example /v1/hooks\\n log(req.queryString); // Raw query params string. For example \\\"limit=12&offset=50\\\"\\n log(JSON.stringify(req.query)); // Parsed query params. For example, req.query.limit\\n\\n return res.send(\\\"All the request parameters are logged to the Appwrite Console.\\\"); Dart import 'dart:async';\\nimport 'dart:convert';\\n\\nFuture main(final context) async {\\n context.log(context.req.bodyRaw); // Raw request body, contains request data\\n context.log(json.encode(context.req.body)); // Object from parsed JSON request body, otherwise string\\n context.log(json.encode(context.req.headers)); // String key-value pairs of all request headers, keys are lowercase\\n context.log(context.req.scheme); // Value of the x-forwarded-proto header, usually http or https\\n context.log(context.req.method); // Request method, such as GET, POST, PUT, DELETE, PATCH, etc.\\n context.log(context.req.url); // Full URL, for example: http://awesome.appwrite.io:8000/v1/hooks?limit=12&offset=50\\n context.log(context.req.host); // Hostname from the host header, such as awesome.appwrite.io\\n context.log(context.req.port); // Port from the host header, for example 8000\\n context.log(context.req.path); // Path part of URL, for example /v1/hooks\\n context.log(context.req.queryString); // Raw query params string. For example \\\"limit=12&offset=50\\\"\\n context.log(json.encode(context.req.query)); // Parsed query params. For example, req.query.limit\\n\\n return context.res.send(\\\"All the request parameters are logged to the Appwrite Console.\\\");\\n} Swift import Foundation\\nimport Foundation\\n\\nfunc main(context: RuntimeContext) async throws -> RuntimeOutput {\\n context.log(context.req.bodyRaw) // Raw request body, contains request data\\n context.log(NSJSONSerialization.jsonObject(with: context.req.body, options: [])!) // Object from parsed JSON request body, otherwise string\\n context.log(NSJSONSerialization.jsonObject(with: context.req.headers, options: [])!) // String key-value pairs of all request headers, keys are lowercase\\n context.log(context.req.scheme) // Value of the x-forwarded-proto header, usually http or https\\n context.log(context.req.method) // Request method, such as GET, POST, PUT, DELETE, PATCH, etc.\\n context.log(context.req.url) // Full URL, for example: http://awesome.appwrite.io:8000/v1/hooks?limit=12&offset=50 \\n context.log(context.req.host) // Hostname from the host header, such as awesome.appwrite.io\\n context.log(context.req.port) // Port from the host header, for example 8000\\n context.log(context.req.path) // Path part of URL, for example /v1/hooks\\n context.log(context.req.queryString) // Raw query params string. For example \\\"limit=12&offset=50\\\"\\n context.log(NSJSONSerialization.jsonObject(with: context.req.query, options: [])!) // Parsed query params. For example, req.query.limit\\n\\n return try context.res.send(\\\"All the request parameters are logged to the Appwrite Console.\\\")\\n} .NET namespace DotNetRuntime;\\n\\nusing System.Text.Json;\\n\\npublic class Handler {\\n public async Task Main(RuntimeContext Context) \\n {\\n Context.Log(Context.Req.BodyRaw); // Raw request body, contains request data\\n Context.Log(JsonSerializer.Serialize(Context.Req.Body)); // Object from parsed JSON request body, otherwise string\\n Context.Log(JsonSerializer.Serialize(Context.Req.Headers)); // String key-value pairs of all request headers, keys are lowercase\\n Context.Log(Context.Req.Scheme); // Value of the x-forwarded-proto header, usually http or https\\n Context.Log(Context.Req.Method); // Request method, such as GET, POST, PUT, DELETE, PATCH, etc.\\n Context.Log(Context.Req.Url); // Full URL, for example: http://awesome.appwrite.io:8000/v1/hooks?limit=12&offset=50\\n Context.Log(Context.Req.Host); // Hostname from the host header, such as awesome.appwrite.io\\n Context.Log(Context.Req.Port); // Port from the host header, for example 8000\\n Context.Log(Context.Req.Path); // Path part of URL, for example /v1/hooks\\n Context.Log(Context.Req.QueryString); // Raw query params string. For example \\\"limit=12&offset=50\\\"\\n Context.Log(JsonSerializer.Serialize(Context.Req.Query)); // Parsed query params. For example, req.query.limit\\n\\n return Context.Res.Send(\\\"All the request parameters are logged to the Appwrite Console.\\\");\\n }\\n} Kotlin package io.openruntimes.kotlin.src\\n\\nimport io.openruntimes.kotlin.RuntimeContext\\nimport io.openruntimes.kotlin.RuntimeOutput\\nimport com.google.gson.Gson\\n\\nclass Main {\\n fun main(context: RuntimeContext): RuntimeOutput {\\n val gson = Gson()\\n\\n context.log(context.req.bodyRaw) // Raw request body, contains request data\\n context.log(gson.toString(context.req.body)) // Object from parsed JSON request body, otherwise string\\n context.log(gson.toString(context.req.headers)) // String key-value pairs of all request headers, keys are lowercase\\n context.log(context.req.scheme) // Value of the x-forwarded-proto header, usually http or https\\n context.log(context.req.method) // Request method, such as GET, POST, PUT, DELETE, PATCH, etc.\\n context.log(context.req.url) // Full URL, for example: http://awesome.appwrite.io:8000/v1/hooks?limit=12&offset=50\\n context.log(context.req.host) // Hostname from the host header, such as awesome.appwrite.io\\n context.log(context.req.port) // Port from the host header, for example 8000\\n context.log(context.req.path) // Path part of URL, for example /v1/hooks\\n context.log(context.req.queryString) // Raw query params string. For example \\\"limit=12&offset=50\\\"\\n context.log(gson.toString(context.req.query)) // Parsed query params. For example, req.query.limit\\n\\n return context.res.send(\\\"All the request parameters are logged to the Appwrite Console.\\\")\\n }\\n} Java package io.openruntimes.java;\\n\\nimport com.google.gson.Gson;\\nimport io.openruntimes.java.models.RuntimeContext;\\nimport io.openruntimes.java.models.RuntimeOutput;\\n\\npublic class Main {\\n public RuntimeOutput main(RuntimeContext context) {\\n Gson gson = new Gson();\\n\\n context.log(context.getReq().getBodyRaw()); // Raw request body, contains request data\\n context.log(gson.toString(context.getReq().getBody())); // Object from parsed JSON request body, otherwise string\\n context.log(gson.toString(context.getReq().getHeaders())); // String key-value pairs of all request headers, keys are lowercase\\n context.log(context.getReq().getScheme()); // Value of the x-forwarded-proto header, usually http or https\\n context.log(context.getReq().getMethod()); // Request method, such as GET, POST, PUT, DELETE, PATCH, etc.\\n context.log(context.getReq().getUrl()); // Full URL, for example: http://awesome.appwrite.io:8000/v1/hooks?limit=12&offset=50\\n context.log(context.getReq().getHost()); // Hostname from the host header, such as awesome.appwrite.io\\n context.log(context.getReq().getPort()); // Port from the host header, for example 8000\\n context.log(context.getReq().getPath()); // Path part of URL, for example /v1/hooks\\n context.log(context.getReq().getQueryString()); // Raw query params string. For example \\\"limit=12&offset=50\\\"\\n context.log(gson.toString(context.getReq().getQuery())); // Parsed query params. For example, req.query.limit\\n\\n return context.getRes().send(\\\"All the request parameters are logged to the Appwrite Console.\\\");\\n }\\n} \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/functions-develop"}} \ No newline at end of file diff --git a/docs/4eecfeda-4583-11ee-9922-f2ea36f81204.json b/docs/4eecfeda-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..58e6157 --- /dev/null +++ b/docs/4eecfeda-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Deployment \", \"body\": [\" Appwrite Functions are mini-applications in Appwrite with their own endpoints. Each function can have many deployments, which can be thought of as versions of the mini-application.\", \" Functions can be created and deployed in different ways to meet your unique development habits. You can automatically deploy Appwrite Functions from source control, build your own deployment pipelines using the Appwrite CLI, or upload code files manually. Here's everything you need to know to deploy your first Appwrite Function.\"]}, {\"level\": 2, \"title\": \"Git\", \"body\": [\" The recommended way to manage your Appwrite Function deployments is to use a version control system, like Git. This offers simple versioning and collaboration that will easily fit into the rest of your development workflow.\"]}, {\"level\": 3, \"title\": \"Create Function\", \"body\": [\"Before deploying your function with Git, create a new function attached to your Git repo.\", \" Navigate to Functions from the side bar of the Appwrite Console. Click Create function. When asked to Choose your source, under Connect Git repository, select your provider. Search for the Git repository that hold your function and click connect. Select a production branch. New commits pushed to the production branch will be automatically activated. Commits to any other branch will still be deployed, but not be activated. Input the root directory of the function inside the repository. If you have only one function in your repository, you can leave this empty. If you have multiple, root directory should point to the folder of your function. This should be the directory in which your custom build commands can run successfully. It also improves efficiency because only what's necessary is cloned. If you don't want deploy comments to be made on your pull requests or commits, select Silent mode. Name your function, select a runtime that matches your function, and enter entrypoint, relative to the root directory from the previous step. Entrypoint is path to the main file of your function, which exports the function to be run on every execution. If you have build steps, like installing dependencies, input the commands into the Build settings heading's Command field. You can combine multiple commands using &&, such as npm install && npm build. For compiled languages you don't need to worry about installing dependencies, as that's done automatically during compilation step. Finally, configure the execute permissions of the function. For security, only provide execute permissions to the necessary roles. \"]}, {\"level\": 3, \"title\": \"Deploy\", \"body\": [\" Using Git, checkout the branch you configured as production branch when creating the Appwrite Function. Create a new commit. Push your new commit. A new deployment will be automatically created, built and activated. \"]}, {\"level\": 2, \"title\": \"CLI\", \"body\": [\" CLI Setup Before you can deploy with the Appwrite CLI, make sure you've installed and initialized the CLI.\", \" To deploy with the Appwrite CLI, your function must be added to appwrite.json that tells the CLI where each function is stored. To ensure the folder structure is setup correctly and appwrite.json is configured correctly, use the appwrite init function method to create a starter function, then paste in your function code.\", \" Run the following command in the folder holding the appwrite.json file. \", \" appwrite init function\", \" Give your function a name and choose your runtime. This will create a new starter function in the current directory and also add it to your appwrite.json file.\", \" Edit the automatically generated code and add dependencies to the dependency files of your language or framework. Then, deploy the function using the following command.\", \" appwrite deploy function\", \" Overwrite Warning If you made changes in the Appwrite Console that is different from your appwrite.json, using the CLI deploy command will overwrite your console changes, such as execution schedule or permissions. Update your appwrite.json manually before deploying to avoid overwriting changes. \"]}, {\"level\": 3, \"title\": \"Manual Deployment\", \"body\": [\"You can upload your functions to be deployed using the Appwrite Console. The example below shows a simple Node.js function, but the same idea applies to any other language.\", \" .\\n\\u251c\\u2500\\u2500 package.json\\n\\u2514\\u2500\\u2500 index.js\\n\", \"First, navigate inside the folder that contains your dependency file. Package your code files into the .tar.gz format with this tar command:\", \" Unix tar --exclude code.tar.gz -czf code.tar.gz . CMD tar --exclude code.tar.gz -czf code.tar.gz . PowerShell tar --exclude code.tar.gz -czf code.tar.gz . \", \"Next, navigate to your Appwrite Console and upload the function.\", \" Navigate to the function you want to deploy. Click Create deployment. Select the Manual tab. Input the entry point of your function under Entrypoint. For the example above, it would be index.js. Upload code.tar.gz. Select Activate deployment after build to use your new deployment. Click Create to deploy your function.\"]}, {\"level\": 2, \"title\": \"Domains\", \"body\": [\" Each deployed function can have its own domain. By default, one is generated for each of your functions. You can find the generated domain for your function like this.\", \" Navigate to the Appwrite Console's Functions page. Navigate to the Domains tab. In the table, you'll find a link formatted similar to https://64d4d22db370ae41a32e.appwrite.global. This is your generated domain.\", \" You can also add a custom domain, which allows you to build custom REST APIs using nothing but Appwrite Functions. To do this, you need to first buy and register a domain. After obtaining a domain, follow these steps to add the domain to Appwrite.\", \" Navigate to the Appwrite Console's Functions page. Navigate to the Domains tab. Click on Create domain. Input your domain in the Domain input field and click Next. Copy the CNAME record provided to you, and add it to your domain registrar. Click Go to console and wait for the domain name to be verified and certificate to generate.\", \" DNS records can take up to 48 hours to propagate after they're added. Please retry verification over the next 48 hours. If the domain verification still fails and you have confirmed DNS records are added correctly, please contact support.\"]}, {\"level\": 2, \"title\": \"Debugging Build\", \"body\": [\"After deploying a function, you can find the status of the deployment and build logs in the Appwrite Console.\", \" In Appwrite Console, navigate to Functions. Click to open a function you wish to inspect. Under the Deployments tab, you'll find the status of the current active deployment and previous inactive deployments. You can access build logs for the active deployment by clicking the Build logs button. You can click on an inactive function's three dots button to find their build logs.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/functions-deploy"}} \ No newline at end of file diff --git a/docs/4eed066e-4583-11ee-9922-f2ea36f81204.json b/docs/4eed066e-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..5ae0751 --- /dev/null +++ b/docs/4eed066e-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Execution \", \"body\": [\" Appwrite Functions can be executed in several ways. Executions can be invoked through the Appwrite SDK and visiting its REST endpoint. Functions can also be triggered by events and scheduled executions. Here are all the different ways to consume your Appwrite Functions.\"]}, {\"level\": 2, \"title\": \"Domains\", \"body\": [\" Each Appwrite function has its own domain. You can find this in the Appwrite Console, under the Function overview.\", \" The generated domains will look like this.\", \" https://64d4d22db370ae41a32e.appwrite.global\", \" Alternatively you can add a custom domain to your Appwrite Function. \"]}, {\"level\": 2, \"title\": \"REST API\", \"body\": [\" When requests are made to this domain, whether through a browser or through an HTTP requests, the request information like request URL, request headers, and request body will be passed to the function. This unlocks ability for Appwrite Function to become a full-blown API server on its own. It also allows accepting incoming webhooks for handling online payments, hosting social platform bots, and much more.\", \" curl -X POST https://64d4d22db370ae41a32e.appwrite.global \\\\\\n -H \\\"X-Custom-Header: 123\\\" \\\\\\n -H \\\"Content-Type: application/json\\\" \\\\\\n -d '{\\\"data\\\":\\\"this is json data\\\"}'\"]}, {\"level\": 2, \"title\": \"SDK\", \"body\": [\" You can invoke your Appwrite Functions directly from the Appwrite SDKs.\", \"Learn more about using the Appwrite SDKs\"]}, {\"level\": 3, \"title\": \"Client SDKs\", \"body\": [\" Web import { Client, Functions } from 'appwrite'; \\n\\nconst client = new Client()\\n\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]')\\n\\nconst functions = new Functions(client)\\n\\ntry {\\n const data = await functions.createExecution('[FUNCTION_ID]', JSON.stringify({\\n 'foo': 'bar'\\n }), '/', 'GET', {\\n 'X-Custom-Header': '123'\\n })\\n console.log(data)\\n} catch (err) {\\n console.error(err.message)\\n} Flutter import 'package:appwrite/appwrite.dart';\\nimport 'dart:convert';\\n\\nfinal client = Client();\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]')\\n\\nfinal functions = Functions(client);\\n\\ntry {\\n final response = await functions.createExecution('[FUNCTION_ID]', json.encode({\\n 'foo': 'bar'\\n }), '/', 'GET', {\\n 'X-Custom-Header': '123'\\n });\\n print(response.data);\\n} catch (e) {\\n print(e.message);\\n} Android import io.appwrite.Client;\\nimport io.appwrite.services.Functions;\\nimport com.google.gson.Gson;\\n\\nval client = new Client();\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]')\\n\\nval functions = new Functions(client);\\n\\ntry {\\n val response = await functions.createExecution('[FUNCTION_ID]', gson.toString({\\n 'foo': 'bar'\\n }), '/', 'GET', {\\n 'X-Custom-Header': '123'\\n });\\n print(response.data);\\n} catch (e) {\\n print(e.message);\\n} Apple import Appwrite\\nimport Foundation\\n\\nlet client = Client()\\nclient\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet functions = Functions(client: client)\\n\\ndo {\\n let response = try functions.createExecution(\\n functionId: \\\"[FUNCTION_ID]\\\",\\n data: NSJSONSerialization.jsonObject(with: [\\\"foo\\\": \\\"bar\\\"], options: [])!,\\n xpath: \\\"/\\\",\\n method: \\\"GET\\\",\\n headers: [\\n \\\"X-Custom-Header\\\": \\\"123\\\"\\n ]\\n )\\n print(response)\\n} catch let error {\\n print(error)\\n} \"]}, {\"level\": 3, \"title\": \"Server SDKs\", \"body\": [\" Node.js import { Client, Functions } from 'node-appwrite'; \\n\\nconst client = new Client()\\n\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]')\\n .setKey('[API_KEY]')\\n\\nconst functions = new Functions(client)\\n\\ntry {\\n const data = await functions.createExecution('[FUNCTION_ID]', JSON.stringify({\\n 'foo': 'bar'\\n }), '/', 'GET', {\\n 'X-Custom-Header': '123'\\n })\\n console.log(data)\\n} catch (err) {\\n console.error(err.message)\\n}\\n\\n PHP setEndpoint('https://cloud.appwrite.io/v1')\\n ->setProject('[PROJECT_ID]')\\n ->setKey('[API_KEY]')\\n;\\n\\n$functions = new Functions($client);\\n\\n$result = $functions->createExecution('[FUNCTION_ID]', json_encode([\\n 'foo' => 'bar' \\n], '/', 'GET', [\\n 'X-Custom-Header': '123'\\n]); Python from appwrite.client import Client\\nfrom appwrite.services.functions import Functions\\nimport json\\n\\nclient = Client()\\n\\n(client\\n .set_endpoint('https://cloud.appwrite.io/v1')\\n .set_project('[PROJECT_ID]')\\n .set_key('[API_KEY]')\\n)\\n\\nfunctions = Functions(client)\\n\\nresult = functions.create_execution('[FUNCTION_ID]', json.dumps({\\n 'foo': 'bar'\\n}, '/', 'GET', {\\n 'X-Custom-Header': '123'\\n}) Ruby require 'Appwrite'\\nrequire 'json'\\n\\ninclude Appwrite\\n\\nclient = Client.new\\n .set_endpoint('https://cloud.appwrite.io/v1') \\n .set_project('[PROJECT_ID]') \\n .set_key('[API_KEY]') \\n\\nfunctions = Functions.new(client)\\n\\nresponse = functions.create_execution(function_id: '[FUNCTION_ID]', data: JSON.generate({\\n 'foo': 'bar'\\n}), '/', 'GET', {\\n 'X-Custom-Header': '123'\\n})\\n\\nputs response.inspect Deno import { Client, Functions } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n\\nconst client = new Client()\\n\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1') \\n .setProject('[PROJECT_ID]')\\n .setKey('[API_KEY]')\\n\\nconst functions = new Functions(client)\\n\\ntry {\\n const data = await functions.createExecution('[FUNCTION_ID]', JSON.stringify({\\n 'foo': 'bar'\\n }), '/', 'GET', {\\n 'X-Custom-Header': '123'\\n })\\n console.log(data)\\n} catch (err) {\\n console.error(err.message)\\n} Dart import 'package:dart_appwrite/dart_appwrite.dart';\\nimport 'dart:convert';\\n\\nvoid main() {\\n Client client = Client();\\n Functions functions = Functions(client);\\n\\n client\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]')\\n .setKey('[API_KEY]')\\n ;\\n\\n Future result = functions.createExecution(\\n functionId: '[FUNCTION_ID]',\\n data: json.encode({\\n 'foo': 'bar'\\n }),\\n xpath: '/',\\n method: 'GET',\\n headers: {\\n 'X-Custom-Header': '123'\\n }\\n );\\n\\n result\\n .then((response) {\\n print(response);\\n }).catchError((error) {\\n print(error.response);\\n });\\n} Swift import Appwrite\\nimport Foundation\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n .setKey(\\\"[API_KEY]\\\")\\n\\nlet functions = Functions(client)\\n\\nlet execution = try await functions.createExecution(\\n functionId: \\\"[FUNCTION_ID]\\\",\\n data: NSJSONSerialization.jsonObject(with: [\\n \\\"foo\\\": \\\"bar\\\"\\n ], options: [])!),\\n xpath: '/',\\n method: 'GET',\\n headers: [\\n \\\"X-Custom-Header\\\": \\\"123\\\"\\n]) .NET using Appwrite;\\nusing Appwrite.Services;\\nusing Appwrite.Models;\\nusing System.Text.Json;\\n\\nvar client = new Client()\\n .SetEndPoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .SetProject(\\\"[PROJECT_ID]\\\")\\n .SetKey(\\\"[API_KEY]\\\");\\n\\nvar functions = new Functions(client);\\n\\nExecution result = await functions.CreateExecution(\\n functionId: \\\"[FUNCTION_ID]\\\",\\n data: JsonSerializer.Serialize(new Dictionary {\\n { \\\"foo\\\", \\\"bar\\\" }\\n }),\\n xpath: \\\"/\\\",\\n method: \\\"GET\\\",\\n headers: new Dictionary {\\n { \\\"X-Custom-Header\\\", \\\"123\\\" }\\n}); Kotlin import io.appwrite.Client\\nimport io.appwrite.services.Functions\\nimport com.google.gson.Gson\\n\\nfun main(args: Array) {\\n val client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n .setKey(\\\"[API_KEY]\\\")\\n\\n val functions = Functions(client)\\n\\n val response = functions.createExecution(\\n functionId = \\\"[FUNCTION_ID]\\\",\\n data = gson.toString(mapOf(\\n \\\"foo\\\" to \\\"bar\\\"\\n )),\\n xpath = \\\"/\\\",\\n method = \\\"GET\\\",\\n headers = mapOf(\\n \\\"X-Custom-Header\\\" to \\\"123\\\"\\n )\\n )\\n}\\n\\n Java import io.appwrite.Client;\\nimport io.appwrite.services.Functions;\\nimport java.util.HashMap;\\nimport com.google.gson.Gson;\\n\\npublic static void main(String[] args) throws Exception {\\n Client client = new Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n .setKey(\\\"[API_KEY]\\\");\\n\\n Functions functions = new Functions(client);\\n\\n functions.createExecution(\\n \\\"[FUNCTION_ID]\\\",\\n new CoroutineCallback<>((result, error) -> {\\n if (error != null) {\\n error.printStackTrace();\\n return;\\n }\\n\\n System.out.println(result);\\n }),\\n gson.toString(new HashMap() {{\\n put(\\\"foo\\\", \\\"bar\\\");\\n }}),\\n \\\"/\\\",\\n \\\"GET\\\",\\n new HashMap() {{\\n put(\\\"X-Custom-Header\\\", \\\"123\\\");\\n }},\\n );\\n} \"]}, {\"level\": 2, \"title\": \"Console\", \"body\": [\" Another easy way to test a function is directly in the Appwrite Console. You test a function by hitting the Execute now button, which will display with modal below. You'll be able to mock executions by configuring the path, method, headers, and body.\", \" \\\"Execute Function\\\" modal. \"]}, {\"level\": 2, \"title\": \"Events\", \"body\": [\" Changes in Appwrite emit events. You can configure Functions to be executed in response to these events.\", \" In Appwrite Console, navigate to Functions. Click to open a function you wish to configure.Under the Settings tab, navigate to Events. Add one or multiple events as triggers for the function. Be careful to avoid selecting events that can be caused by the function itself. This can cause the function to trigger its own execution, resulting in infinite recursions. \"]}, {\"level\": 2, \"title\": \"Schedule\", \"body\": [\"Appwrite supports scheduled function executions. You can schedule executions using cron expressions in the settings of your function. Cron supports recurring executions as frequently as every minute.\", \"Here are some cron expressions for common intervals.\", \" Cron Expression Schedule */15 * * * * Every 15 minutes 0 * * * * Every Hour 0 0 * * * Every day at 00:00 0 0 * * 1 Every monday at 00:00 \"]}, {\"level\": 2, \"title\": \"Permissions\", \"body\": [\" Appwrite Functions can be executed using Client or Server SDKs. Client SDKs must be authenticated with an account that has been granted execution permissions on the function's settings page. Server SDKs require an API key with the correct scopes.\", \" If your function has a generated or custom domain, executions are not authenticated. Anyone visiting the configured domains will be considered a guest, so make sure to give `Any` execute permission in order for domain executions to work. If you need to enforce permissions for functions with a domain, use authentication methods like JWT.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/functions-execute"}} \ No newline at end of file diff --git a/docs/4eed1410-4583-11ee-9922-f2ea36f81204.json b/docs/4eed1410-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..9701dcd --- /dev/null +++ b/docs/4eed1410-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Runtimes \", \"body\": [\" Appwrite Functions supports an extensive list of runtimes to meet your unique tech preferences. Not all runtimes are available on Appwrite Cloud yet. Check for the Cloud label in each listed runtime to know which ones are available.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/functions-runtimes"}} \ No newline at end of file diff --git a/docs/4eed1a82-4583-11ee-9922-f2ea36f81204.json b/docs/4eed1a82-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..e2df688 --- /dev/null +++ b/docs/4eed1a82-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Examples \", \"body\": [\" Appwrite Functions is all about flexibility. Behind the simple workflow hides some useful examples that can help you accomplish your goals faster. Take a look at the following.\"]}, {\"level\": 2, \"title\": \"Currency Conversion API\", \"body\": [\" Here's a currency conversion API that converts from Euros and Indian Rupees to US Dollars. We'll use an external API to get the latest exchange rates, and query it using an dependency specific to each runtime.\"]}, {\"level\": 3, \"title\": \"Prerequisites\", \"body\": [\" Node.js Run the following bash command to create a package.json file. This file is used to manage your Node.js project's dependencies. npm init -y Install the undici library. This library includes a fetch function that you can use to make HTTP requests. npm install undici Finally, add npm install to your function's build commands in the Appwrite Console. PHP Run the following bash command to create a composer.json file. This file is used to manage your PHP project's dependencies. composer init -y Install the guzzlehttp/guzzle library. This library includes a get function that you can use to make HTTP requests. composer require guzzlehttp/guzzle Finally, add composer install to your function's build commands in the Appwrite Console. Python Run the following bash command to create a requirements.txt file. This file is used to manage your Python project's dependencies. touch requirements.txt Install the requests library. This library includes a get function that you can use to make HTTP requests. echo \\\"requests\\\" >> requirements.txt\\npip install -r requirements.txt Finally, add pip install -r requirements.txt to your function's build commands in the Appwrite Console. Dart Create a pubspec.yaml file with the following contents. This file is used to manage your Dart project's dependencies. name: appwrite_function\\ndescription: Appwrite Function\\nversion: 1.0.0\\nenvironment:\\n sdk: '>=2.12.0 <3.0.0' Install the http library. This library includes a get function that you can use to make HTTP requests. pub install http Finally, add pub get to your function's build commands in the Appwrite Console. Ruby Create a Gemfile file with the following contents. This file is used to manage your Ruby project's dependencies. source 'https://rubygems.org' Install the httparty library. This library includes a get function that you can use to make HTTP requests. echo \\\"gem 'httparty'\\\" >> Gemfile\\nbundle install Finally, add bundle install to your function's build commands in the Appwrite Console. \"]}, {\"level\": 3, \"title\": \"Code\", \"body\": [\" Node.js import { fetch } from 'undici';\\n\\nexport default async function ({ req, res }) {\\n if (req.path === '/eur') {\\n const amountInEuros = Number(req.query.amount);\\n const response = await fetch('https://api.exchangerate.host/latest?base=EUR&symbols=USD');\\n const data = await response.json();\\n const amountInDollars = amountInEuros * data.rates.USD;\\n return res.send(amountInDollars.toString());\\n }\\n\\n if (req.path === '/inr') {\\n const amountInRupees = Number(req.query.amount);\\n const response = await fetch('https://api.exchangerate.host/latest?base=INR&symbols=USD');\\n const data = await response.json();\\n const amountInDollars = amountInRupees * data.rates.USD;\\n return res.send(amountInDollars.toString());\\n }\\n\\n return res.send('Invalid path');\\n}; Python import requests\\n\\ndef main(context):\\n if context.req.path == '/eur':\\n amount_in_euros = float(context.req.query['amount'])\\n response = requests.get('https://api.exchangerate.host/latest?base=EUR&symbols=USD')\\n data = response.json()\\n amount_in_dollars = amount_in_euros * data['rates']['USD']\\n return context.res.send(str(amount_in_dollars))\\n\\n if context.req.path == '/inr':\\n amount_in_rupees = float(context.req.query['amount'])\\n response = requests.get('https://api.exchangerate.host/latest?base=INR&symbols=USD')\\n data = response.json()\\n amount_in_dollars = amount_in_rupees * data['rates']['USD']\\n return context.res.send(str(amount_in_dollars))\\n\\n return 'Invalid path' Dart import 'dart:async';\\nimport 'package:http/http.dart' as http;\\n\\nFuture main(final context) async {\\n if (context.req.path == '/eur') {\\n final amountInEuros = double.parse(context.req.query['amount'])\\n final response = await http.get(Uri.parse('https://api.exchangerate.host/latest?base=EUR&symbols=USD'));\\n final data = json.decode(response.body);\\n final amountInDollars = amountInEuros * data['rates']['USD'];\\n return context.res.send(amountInDollars.toString());\\n }\\n\\n if (context.req.path == '/inr') {\\n final amountInRupees = double.parse(context.req.query['amount'])\\n final response = await http.get(Uri.parse('https://api.exchangerate.host/latest?base=INR&symbols=USD'));\\n final data = json.decode(response.body);\\n final amountInDollars = amountInRupees * data['rates']['USD'];\\n return context.res.send(amountInDollars.toString());\\n }\\n\\n return 'Invalid path';\\n} Ruby require 'httparty'\\n\\ndef main(context)\\n if context.req.path == '/eur'\\n amount_in_euros = context.req.query['amount'].to_f\\n response = HTTParty.get('https://api.exchangerate.host/latest?base=EUR&symbols=USD')\\n data = JSON.parse(response.body)\\n amount_in_dollars = amount_in_euros * data['rates']['USD']\\n return context.res.send(amount_in_dollars.to_s)\\n end\\n\\n if context.req.path == '/inr'\\n amount_in_rupees = context.req.query['amount'].to_f\\n response = HTTParty.get('https://api.exchangerate.host/latest?base=INR&symbols=USD')\\n data = JSON.parse(response.body)\\n amount_in_dollars = amount_in_rupees * data['rates']['USD']\\n return context.res.send(amount_in_dollars.to_s)\\n end\\n\\n return 'Invalid path'\\nend \", \" Use the function by navigating to function URL in the browser. The path should contain the currency and amount parameter. For example, [YOUR_FUNCTION_URL]/eur?amount=5 should convert Euros to Dollars.\"]}, {\"level\": 2, \"title\": \"Voting System Using Appwrite\", \"body\": [\" Here's a simple voting system that allows users to vote on various topics. Appwrite Functions and the server SDK are used to enforce voting rules and prevent multiple votes from the same user for a single topic.\"]}, {\"level\": 3, \"title\": \"Prerequisites\", \"body\": [\"Create a Topics collection with the following attributes:\", \" Name Type Description title string The name of the topic description string Long form description of the topic \", \"Create a Votes collection with the following attributes:\", \" Name Type Description userId string The ID of the user who cast the vote topicId string The ID of the topic that was voted on vote string The vote cast by the user. Must be either \\\"yes\\\" or \\\"no\\\" \"]}, {\"level\": 3, \"title\": \"Code\", \"body\": [\" Node.js import { Client, Databases, Query } from 'node-appwrite';\\n\\nexport default async function ({ req, res }) {\\n const vote = {\\n userId: req.query.userId,\\n topicId: req.query.topicId,\\n vote: req.query.vote\\n };\\n\\n if (vote.vote !== 'yes' && vote.vote !== 'no') {\\n return res.json({ ok: false, message: 'You must vote yes or no.' }, 400);\\n }\\n\\n const client = new Client();\\n client\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)\\n .setKey(process.env.APPWRITE_API_KEY);\\n\\n const database = new Database(client);\\n \\n const existingVotes = await database.listDocuments('[VOTES_COLLECTION_ID]', [\\n Query.equals('userId', vote.userId),\\n Query.equals('topicId', vote.topicId)\\n ]);\\n\\n if (existingVotes.total > 0) {\\n return res.json({ ok: false, message: 'You have already voted on this topic.' }, 400);\\n }\\n\\n const voteDocument = await database.createDocument('[VOTES_COLLECTION_ID]', {\\n userId,\\n topicId,\\n vote,\\n });\\n\\n return res.json({ ok: true, message: 'Vote cast.', vote: voteDocument });\\n} Python from appwrite.client import Client\\nfrom appwrite.services.databases import Databases\\nfrom appwrite.query import Query\\nimport os\\n\\ndef main(context):\\n vote = {\\n 'userId': context.req.query['userId'],\\n 'topicId': context.req.query['topicId'],\\n 'vote': context.req.query['vote']\\n }\\n\\n if vote['vote'] != 'yes' and vote['vote'] != 'no':\\n return context.res.json({'ok': False, 'message': 'You must vote yes or no.'}, 400)\\n\\n client = Client()\\n client.set_endpoint('https://cloud.appwrite.io/v1')\\n client.set_project(os.environ['APPWRITE_FUNCTION_PROJECT_ID'])\\n client.set_key(os.environ['APPWRITE_API_KEY'])\\n\\n database = Databases(client)\\n \\n existing_votes = database.list_documents('[VOTES_COLLECTION_ID]', [\\n Query.equals('userId', vote['userId']),\\n Query.equals('topicId', vote['topicId'])\\n ])\\n\\n if existing_votes['total'] > 0:\\n return context.res.json({\\n 'ok': False, \\n 'message': 'You have already voted on this topic.'\\n }, 400)\\n\\n vote_document = database.create_document('[VOTES_COLLECTION_ID]', {\\n 'userId': vote['userId'],\\n 'topicId': vote['topicId'],\\n 'vote': vote['vote'],\\n })\\n\\n return context.res.json({'ok': True, 'message': 'Vote cast.', 'vote': vote_document}) PHP $context->req->query['userId'],\\n 'topicId' => $context->req->query['topicId'],\\n 'vote' => $context->req->query['vote']\\n ];\\n\\n if ($vote['vote'] !== 'yes' && $vote['vote'] !== 'no') {\\n return $context->res->json(['ok' => false, 'message' => 'You must vote yes or no.'], 400);\\n }\\n\\n $client = new Client();\\n $client\\n ->setEndpoint('https://cloud.appwrite.io/v1')\\n ->setProject(getenv('APPWRITE_FUNCTION_PROJECT_ID'))\\n ->setKey(getenv('APPWRITE_API_KEY'));\\n\\n $database = new Database($client);\\n\\n $existingVotes = $database->listDocuments('[VOTES_COLLECTION_ID]', [\\n Query->equal('userId', $vote['userId']),\\n Query->equal('topicId', $vote['topicId'])\\n ]);\\n\\n if ($existingVotes['total'] > 0) {\\n return $context->res->json([\\n 'ok' => false, \\n 'message' => 'You have already voted on this topic.'\\n ], 400);\\n }\\n\\n $voteDocument = $database->createDocument('[VOTES_COLLECTION_ID]', [\\n 'userId' => $vote['userId'],\\n 'topicId' => $vote['topicId'],\\n 'vote' => $vote['vote'],\\n ]);\\n\\n return $context->res->json([\\n 'ok' => true, \\n 'message' => 'Vote cast.', \\n 'vote' => $voteDocument\\n ]);\\n}; Ruby require \\\"appwrite\\\"\\n\\ndef main(context)\\n vote = {\\n 'userId' => context.req.query['userId'],\\n 'topicId' => context.req.query['topicId'],\\n 'vote' => context.req.query['vote']\\n }\\n\\n if vote['vote'] != 'yes' and vote['vote'] != 'no'\\n return context.res.json({'ok': false, 'message': 'You must vote yes or no.'}, 400)\\n end\\n\\n client = Appwrite::Client.new()\\n client\\n .set_endpoint('https://cloud.appwrite.io/v1')\\n .set_project(ENV['APPWRITE_FUNCTION_PROJECT_ID'])\\n .set_key(ENV['APPWRITE_API_KEY'])\\n\\n database = Appwrite::Database.new(client)\\n \\n existing_votes = database.list_documents('[VOTES_COLLECTION_ID]', [\\n Appwrite::Query.new('userId', '=', vote['userId']),\\n Appwrite::Query.new('topicId', '=', vote['topicId'])\\n ])\\n\\n if existing_votes['total'] > 0\\n return context.res.json({\\n 'ok': false, \\n 'message': 'You have already voted on this topic.'\\n }, 400)\\n end\\n\\n vote_document = database.create_document('[VOTES_COLLECTION_ID]', {\\n 'userId': vote['userId'],\\n 'topicId': vote['topicId'],\\n 'vote': vote['vote'],\\n })\\n\\n return context.res.json({\\n 'ok': true, \\n 'message': 'Vote cast.', \\n 'vote': vote_document\\n })\\nend Dart import 'dart:async';\\nimport 'package:dart_appwrite/dart_appwrite.dart';\\n\\nFuture main(final context) async {\\n final vote = {\\n 'userId': context.req.query['userId'],\\n 'topicId': context.req.query['topicId'],\\n 'vote': context.req.query['vote']\\n };\\n\\n if (vote['vote'] != 'yes' && vote['vote'] != 'no') {\\n return context.res.json({'ok': false, 'message': 'You must vote yes or no.'}, 400);\\n }\\n\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)\\n .setKey(process.env.APPWRITE_API_KEY);\\n\\n final database = Database(client);\\n\\n final existingVotes = await database.listDocuments('[VOTES_COLLECTION_ID]', [\\n Query.equals('userId', vote['userId']),\\n Query.equals('topicId', vote['topicId'])\\n ]);\\n\\n if (existingVotes['total'] > 0) {\\n return context.res.json({\\n 'ok': false, \\n 'message': 'You have already voted on this topic.'\\n }, 400);\\n }\\n\\n final voteDocument = await database.createDocument('[VOTES_COLLECTION_ID]', {\\n 'userId': vote['userId'],\\n 'topicId': vote['topicId'],\\n 'vote': vote['vote'],\\n });\\n\\n return context.res.json({\\n 'ok': true, \\n 'message': 'Vote cast.', \\n 'vote': voteDocument\\n });\\n} Python from appwrite.client import Client\\nfrom appwrite.services.databases import Databases\\nfrom appwrite.query import Query\\n\\nimport os\\n\\ndef main(context):\\n vote = {\\n 'userId': context.req.query['userId'],\\n 'topicId': context.req.query['topicId'],\\n 'vote': context.req.query['vote']\\n }\\n\\n if vote['vote'] != 'yes' and vote['vote'] != 'no':\\n return context.res.json({'ok': False, 'message': 'You must vote yes or no.'}, 400)\\n\\n client = Client()\\n client.set_endpoint('https://cloud.appwrite.io/v1')\\n client.set_project(os.environ['APPWRITE_FUNCTION_PROJECT_ID'])\\n client.set_key(os.environ['APPWRITE_API_KEY'])\\n\\n database = Databases(client)\\n\\n existing_votes = database.list_documents('[VOTES_COLLECTION_ID]', [\\n Query.equal('userId', vote['userId']),\\n Query.equal('topicId', vote['topicId'])\\n ])\\n \\n if existing_votes['total'] > 0:\\n return context.res.json({\\n 'ok': False, \\n 'message': 'You have already voted on this topic.'\\n }, 400)\\n\\n vote_document = database.create_document('[VOTES_COLLECTION_ID]', vote)\\n\\n return context.res.json({\\n 'ok': True, \\n 'message': 'Vote cast.', \\n 'vote': vote_document\\n }) \", \" Use the function by navigating to the function URL in the browser. The URL should contain the required parameters. For example, [YOUR_FUNCTION_URL]/?userId=[USER_ID]&topicId=[TOPIC_ID]&vote=yes to cast a vote.\"]}, {\"level\": 2, \"title\": \"HTML Contact Form\", \"body\": [\" Here's a simple form page that handles form submissions, and can be used to store a user's message in a collection. The form is submitted to the function using the POST method and the form data is sent as a URL-encoded string in the request body.\"]}, {\"level\": 3, \"title\": \"Prerequisites\", \"body\": [\"Create a Messages collection with the following attributes:\", \" Name Type Description name string The name of the message author email string The email of the message author content string The content of the message \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/functions-examples"}} \ No newline at end of file diff --git a/docs/4eed2ab8-4583-11ee-9922-f2ea36f81204.json b/docs/4eed2ab8-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..296091d --- /dev/null +++ b/docs/4eed2ab8-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Migrations \", \"body\": [\" If you're looking to migrate existing projects to Appwrite, Migrations can help you make the move more quickly. You can move your app from Firebase, Supabase, NHost, and even move between self-hosted and Cloud projects using Migrations. You can also use Migrations to move between two self-hosted instances or even to duplicate project on the same instance. Migrations will automatically move accounts, database documents, and storage files from one source to another.\"]}, {\"level\": 2, \"title\": \"Supported sources\", \"body\": [\" You can transfer from these sources to an Appwrite project. Resources marked enabled are migrated automatically. Resources marked partial can be migrated, but with limitations or caveats, check the guide for each source to learn more. Resources marked manual require manual migration.\", \" Source Users Databases Documents Files Functions Firebase enabled enabled partial enabled manual Supabase enabled enabled partial enabled manual NHost enabled enabled partial enabled manual Cloud to Self-hosted enabled enabled enabled enabled enabled Self-hosted to Cloud enabled enabled enabled enabled enabled \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/migrations"}} \ No newline at end of file diff --git a/docs/4eed318e-4583-11ee-9922-f2ea36f81204.json b/docs/4eed318e-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..bc2a852 --- /dev/null +++ b/docs/4eed318e-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Firebase \", \"body\": [\" Moving your project from Firebase to Appwrite? Appwrite Migrations can help you streamline the process. Here's what you need to know to get started.\"]}, {\"level\": 2, \"title\": \"Things to keep in mind\", \"body\": [\" Appwrite will not incur usage charges during migrations, but Firebase may still incur service charges. Appwrite Migrations only supports Firestore as a database source. Realtime Database is currently not supported. At the moment only top level document migration is supported. Nested documents will not be migrated automatically. OAuth users will not be migrated because the sessions are managed by the third-party OAuth provider. Users will need to re-authenticate with your OAuth provider after the migration is complete. Functions are not automatically migrated because of syntax and runtime differences.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/migrations-firebase"}} \ No newline at end of file diff --git a/docs/4eed37ba-4583-11ee-9922-f2ea36f81204.json b/docs/4eed37ba-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..aca6661 --- /dev/null +++ b/docs/4eed37ba-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Supabase \", \"body\": [\" Moving your project from Supabase to Appwrite? Appwrite Migrations can help you streamline the process. Here's what you need to know to get started.\"]}, {\"level\": 2, \"title\": \"Things to keep in mind\", \"body\": [\" Appwrite will not incur usage charges during migrations, but Supabase may still incur service charges. Appwrite's Databases services supports a different set of features as PostgreSQL. Some features like advanced indexes, Postgres functions and scheduling will not be migrated. OAuth users will not be migrated because the sessions are managed by the third-party OAuth provider. Users will need to re-authenticate with your OAuth provider after the migration is complete. Functions are not automatically migrated because of syntax and runtime differences.\"]}, {\"level\": 2, \"title\": \"Migrating to Appwrite from Supabase\", \"body\": [\" To begin migrating to Appwrite make sure to read the migration overview and things to keep in mind sections above.\", \" Create a new project and click on the Migrations tab in Project Settings. Click on the Create Migration button and select Supabase as your source. Enter the credentials following the instructions below and click Next. Select the resources you want to migrate and finally click Start migration to begin the migration process. Finally, add the platforms for your Web, Flutter, Android, and iOS apps. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/migrations-supabase"}} \ No newline at end of file diff --git a/docs/4eed3e22-4583-11ee-9922-f2ea36f81204.json b/docs/4eed3e22-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..0829e0d --- /dev/null +++ b/docs/4eed3e22-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" NHost \", \"body\": [\" Moving your project from NHost to Appwrite? Appwrite Migrations can help you streamline the process. Here's what you need to know to get started.\"]}, {\"level\": 2, \"title\": \"Things to keep in mind\", \"body\": [\" Appwrite will not incur usage charges during migrations, but NHost may still incur service charges. Appwrite's Database doesn't support all the features of the postgreSQL database so more advanced postgres centric things things like advanced indexes, postgres functions and scheduling will not be migrated. OAuth users will not be migrated because the sessions are managed by the third-party OAuth provider. Users will need to re-authenticate with your OAuth provider after the migration is complete. Functions are not automatically migrated because of syntax and runtime differences.\"]}, {\"level\": 2, \"title\": \"Migrating to Appwrite from NHost\", \"body\": [\" To begin migrating to Appwrite make sure to read the migration overview and things to keep in mind sections above.\", \" Create a new project and click on the Migrations tab in Project Settings. Click on the Create Migration button and select NHost as your source. Enter the credentials following the instructions below and click Next. Select the resources you want to migrate and finally click Start migration to begin the migration process. Finally, add the platforms for your Web, Flutter, Android, and iOS apps. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/migrations-nhost"}} \ No newline at end of file diff --git a/docs/4eed457a-4583-11ee-9922-f2ea36f81204.json b/docs/4eed457a-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..4e12fc3 --- /dev/null +++ b/docs/4eed457a-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Cloud to Self-hosted \", \"body\": [\" Moving to a self-hosted instance? We've got you covered. Migrations makes it as easy as a couple clicks to move all of your Appwrite Cloud project data to a self-hosted instance.\"]}, {\"level\": 2, \"title\": \"Things to keep in mind\", \"body\": [\" Data transferred by migrations will reset `$createdAt` and `$updatedAt` timestamps to the date of the migration. Your self-hosted Appwrite project must be accessible from the internet for the migration to work. Migrations are non-destructive. No data will be deleted or lost in the source project.\"]}, {\"level\": 2, \"title\": \"Migrating to Self-hosted from Cloud\", \"body\": [\" To begin migrating to Appwrite Self-hosted, make sure to read the migrations overview and things to keep in mind sections above.\"]}, {\"level\": 3, \"title\": \"Steps on Your Cloud Project\", \"body\": [\" Navigate to your Appwrite Cloud Console and click on the Migrations tab. Click Export to Self-hosted, you will be prompted to input the URL of your self-hosted Appwrite project. Optionally, tell us about why you're moving to self-hosted. After clicking Continue, you'll be directed back to your self-hosted project to complete the process.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/migrations-cloud-to-self-hosted"}} \ No newline at end of file diff --git a/docs/4eed4bba-4583-11ee-9922-f2ea36f81204.json b/docs/4eed4bba-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..94e8825 --- /dev/null +++ b/docs/4eed4bba-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Self-hosted to Cloud \", \"body\": [\" Making the move to Appwrite Cloud? We've got your back. Migrations makes it as easy as a couple clicks to move all of your self-hosted project data to a Cloud instance.\"]}, {\"level\": 2, \"title\": \"Things to keep in mind\", \"body\": [\" Data transferred by migrations will reset $createdAt and $updatedAt timestamps to the date of the migration. Your self-hosted Appwrite project must be accessible from the internet for the migration to work. Migrations are non-destructive. No data will be deleted or lost in the source project.\"]}, {\"level\": 2, \"title\": \"Migrating to Self-hosted from Cloud\", \"body\": [\" To begin migrating to self-hosted, make sure to read the migration overview and things to keep in mind sections above.\"]}, {\"level\": 3, \"title\": \"Steps on Your Self-hosted Project\", \"body\": [\" Navigate to your self-hosted project's console and click on the Migrations tab. Click Deploy to cloud, you will be redirected to Appwrite Cloud. You will complete the migration on Appwrite Cloud.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/migrations-self-hosted-to-cloud"}} \ No newline at end of file diff --git a/docs/ee43d942-1f0c-11ee-98fa-00155da08df7.json b/docs/4eed5268-4583-11ee-9922-f2ea36f81204.json similarity index 79% rename from docs/ee43d942-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eed5268-4583-11ee-9922-f2ea36f81204.json index 90f0b0d..b39347d 100644 --- a/docs/ee43d942-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eed5268-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" API Keys \", \"body\": [\"Using your API Keys, you can access Appwrite services using the SDK of your choice. To create a new API key, go to your API keys tab in your project setting using your Appwrite console and click the 'Add API Key' button.\", \"When adding a new API Key, you can choose which scope to grant your application. If you need to replace your API Key, create a new key, update your app credentials and, once ready, delete your old key.\", \" Best Practice It is a best practice to grant only the scopes you need to meet your project's goals to an API key. API keys should be treated as a secret. Never share the API key and keep API keys out of client applications.\"]}]", "metadata": {"source": "https://appwrite.io/docs/keys"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" API Keys \", \"body\": [\"Using your API Keys, you can access Appwrite services using the SDK of your choice. To create a new API key, go to your API keys tab in your project setting using your Appwrite Console and click the 'Add API Key' button.\", \"When adding a new API Key, you can choose which scope to grant your application. If you need to replace your API Key, create a new key, update your app credentials and, once ready, delete your old key.\", \" Best Practice It is a best practice to grant only the scopes you need to meet your project's goals to an API key. API keys should be treated as a secret. Never share the API key and keep API keys out of client applications.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/keys"}} \ No newline at end of file diff --git a/docs/4eed5858-4583-11ee-9922-f2ea36f81204.json b/docs/4eed5858-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..01f2dd7 --- /dev/null +++ b/docs/4eed5858-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Permissions \", \"body\": [\"Appwrite permission mechanism offers a simple, yet flexible way to manage which users, teams, or roles can access a specific resource in your project, like documents and files.\", \"Using permissions, you can decide that only user A and user B will have read and update access to a specific database document, while user C and team X will be the only ones with delete access.\", \"As the name suggests, read permission allows a user to read a resource, create allows users to create new resources, update allows a user to make changes to a resource, and delete allows the user to remove the resource.\", \"All permissions can be granted to individuals or groups of users, entire teams, or only to team members with a specific role. Permission can also be granted based on authentication status such as to all users, only authenticated users, or only guest users.\", \"A project user can only grant a resource with permissions that they own. For example, if a user is trying to share a document with a team that they are not a member of, they will encounter a 401 not authorized error. If your app needs users to grant access to teams they're not a member of, you can create Appwrite Functions with a Server SDK to achieve this functionality.\", \" Appwrite Resource An Appwrite resource can be a database, collection, document, bucket, or file. Each resource has its own set of permissions to define who can interact with it. Using the Appwrite permissions mechanism, you can grant resource access to users, teams, and members with different roles.\"]}, {\"level\": 2, \"title\": \"Default Values\", \"body\": [\"If you create a resource using a Server SDK or the Appwrite Console without explicit permissions, no one can access it by default because the permissions will be empty. If you create a resource using a Client SDK without explicit permissions, the creator will be granted read, update, and delete permissions on that resource by default.\"]}, {\"level\": 2, \"title\": \"Server Integration\", \"body\": [\"Server integrations can be used for increased flexibility. When using a Server SDK in combination with the proper API key scopes, you can have any type of access to any of your project resources regardless of their permissions.\", \"Using the server integration flexibility, you can change resource permissions, share resources between different users and teams, or edit and delete them without any limitations.\"]}, {\"level\": 2, \"title\": \"Permission Types\", \"body\": [\"In Client and Server SDKs, you will find a Permission class with helper methods for each role described below.\", \" Type Description Permission.read() Access to read a resource. Permission.create() Access to create new resources. Does not apply to files or documents. Applying this type of access to files or documents results in an error. Permission.update() Access to change a resource, but not remove or create new resources. Does not apply to functions. Permission.delete() Access to remove a resource. Does not apply to functions. Permission.write() Alias to grant create, update, and delete access for collections and buckets and update and delete access for documents and files. \"]}, {\"level\": 2, \"title\": \"Permission Roles\", \"body\": [\"In Client and Server SDKs, you will find a Role class with helper methods for each role described below.\", \" Type Description Role.any() Grants access to anyone. Role.guests() Grants access to any guest user without a session. Authenticated users don't have access to this role. Role.users([STATUS]) Grants access to any authenticated or anonymous user. You can optionally pass the verified or unverified string to target specific types of users. Role.user([USER_ID], [STATUS]) Grants access to a specific user by user ID. You can optionally pass the verified or unverified string to target specific types of users. Role.team([TEAM_ID]) Grants access to any member of the specific team. To gain access to this permission, the user must be the team creator (owner), or receive and accept an invitation to join this team. Role.team([TEAM_ID], [ROLE]) Grants access to any member who possesses a specific role in a team. To gain access to this permission, the user must be a member of the specific team and have the given role assigned to them. Team roles can be assigned when inviting a user to become a team member. Role.member([MEMBERSHIP_ID]) Grants access to a specific member of a team. When the member is removed from the team, they will no longer have access. \"]}, {\"level\": 2, \"title\": \"Examples\", \"body\": [\"The examples below will show you how you can use the different Appwrite permissions to manage access control to your project resources.\", \"The following examples are using the Appwrite Web SDK but can be applied similarly to any of the other Appwrite SDKs.\"]}, {\"level\": 3, \"title\": \"Example #1 - Basic Usage\", \"body\": [\"In the following example, we are creating a document that can be read by anyone, edited by writers or admins, and deleted by administrators or a user with the user ID user:5c1f88b42259e.\", \" import { Client, Databases, Permission, Role } from \\\"appwrite\\\";\\n \\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n\\nlet promise = databases.createDocument(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n {'actorName': 'Chris Evans', 'height': 183},\\n [\\n Permission.read(Role.any()), // Anyone can view this document\\n Permission.update(Role.team(\\\"writers\\\")), // Writers can update this document\\n Permission.update(Role.team(\\\"admin\\\")), // Admins can update this document\\n Permission.delete(Role.user(\\\"5c1f88b42259e\\\")) // User 5c1f88b42259e can delete this document\\n Permission.delete(Role.team(\\\"admin\\\")) // Admins can delete this document\\n ]\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n});\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/permissions"}} \ No newline at end of file diff --git a/docs/4eed5fd8-4583-11ee-9922-f2ea36f81204.json b/docs/4eed5fd8-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..ef2ac49 --- /dev/null +++ b/docs/4eed5fd8-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Events \", \"body\": [\"Appwrite provides a variety of events that allows your application to react to changes as they happen. A event will fire when a change occurs in your Appwrite project, like when a new user registers or a new file is uploaded to Appwrite. You can subscribe to these events to with Appwrite Functions, Realtime, or Webhooks.\", \"You can subscribe to events for specific resources using their ID or subscribe to changes of all resources of the same type by using a wildcard character * instead of an ID. You can also filter for events of specific actions like create, update, or delete. You can find a list of events for Storage, Databases, Functions, and Authentication services below.\"]}, {\"level\": 2, \"title\": \"Storage Service\", \"body\": [\" Name Payload Description buckets.* buckets.*.create buckets.*.delete buckets.*.files.* buckets.*.files.*.create buckets.*.files.*.delete buckets.*.files.*.update buckets.*.update \"]}, {\"level\": 2, \"title\": \"Databases Service\", \"body\": [\" Name Payload Description databases.* databases.*.collections.* databases.*.collections.*.attributes databases.*.collections.*.attributes.*.create databases.*.collections.*.attributes.*.delete databases.*.collections.*.create databases.*.collections.*.delete databases.*.collections.*.documents databases.*.collections.*.documents.*.create databases.*.collections.*.documents.*.delete databases.*.collections.*.documents.*.update databases.*.collections.*.indexes databases.*.collections.*.indexes.*.create databases.*.collections.*.indexes.*.delete databases.*.collections.*.update databases.*.create databases.*.delete databases.*.update \"]}, {\"level\": 2, \"title\": \"Functions Service\", \"body\": [\" Name Payload Description functions.* functions.*.create functions.*.delete functions.*.deployments.* functions.*.deployments.*.create functions.*.deployments.*.delete functions.*.deployments.*.update functions.*.executions.* functions.*.executions.*.create functions.*.executions.*.delete functions.*.executions.*.update functions.*.update \"]}, {\"level\": 2, \"title\": \"Authentication Service\", \"body\": [\" Name Payload Description teams.* teams.*.create teams.*.delete teams.*.memberships.* teams.*.memberships.*.create teams.*.memberships.*.delete teams.*.memberships.*.update teams.*.memberships.*.update.*.status teams.*.update teams.*.update.*.prefs users.* users.*.create users.*.delete users.*.recovery.* users.*.recovery.*.create users.*.recovery.*.update users.*.sessions.* users.*.sessions.*.create users.*.sessions.*.delete users.*.update users.*.update.*.email users.*.update.*.name users.*.update.*.password users.*.update.*.prefs users.*.update.*.status users.*.verification.* users.*.verification.*.create users.*.verification.*.update \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/events"}} \ No newline at end of file diff --git a/docs/ee43e1bc-1f0c-11ee-98fa-00155da08df7.json b/docs/4eed65b4-4583-11ee-9922-f2ea36f81204.json similarity index 98% rename from docs/ee43e1bc-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eed65b4-4583-11ee-9922-f2ea36f81204.json index 7470779..cc9e48f 100644 --- a/docs/ee43e1bc-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eed65b4-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Queries \", \"body\": [\"Many list endpoints in Appwrite allow you to filter, sort, and paginate results using queries. Appwrite provides a common set of syntax to build queries.\"]}, {\"level\": 2, \"title\": \"Query Compatibility\", \"body\": [\"Each list endpoint supports different query operations. You can find the supported query methods and attributes in the References section of the Appwrite documentation.\"]}, {\"level\": 2, \"title\": \"Query Class\", \"body\": [\"Appwrite SDKs provide a Query class to help you build queries. The Query class has a method for each type of supported query.\", \" Query Method SDK Method Example Description Select Query.select([\\\"name\\\", \\\"title\\\"]) Select which attributes should be returned from a document. Equal Query.equal(\\\"title\\\", [\\\"Iron Man\\\"]) Returns document if attribute is equal to any value in the provided array. Not Equal Query.notEqual(\\\"title\\\", [\\\"Iron Man\\\"]) Returns document if attribute is not equal to any value in the provided array. Less Than Query.lessThan(\\\"score\\\", 10) Returns document if attribute is less than the provided value. Less Than or Equal Query.lessThanEqual(\\\"score\\\", 10) Returns document if attribute is less than or equal to the provided value. Greater Than Query.greaterThan(\\\"score\\\", 10) Returns document if attribute is greater than the provided value. Greater Than or Equal Query.greaterThanEqual(\\\"score\\\", 10) Returns document if attribute is greater than or equal to the provided value. Between Query.between(\\\"price\\\", 5, 10) Returns document if attribute value falls between the two values. The boundary values are inclusive and can be strings or numbers. Is Null Query.isNull(\\\"name\\\") Returns documents where attribute value is null. Is Not Null Query.isNotNull(\\\"name\\\") Returns documents where attribute value is not null. Starts With Query.startsWith(\\\"name\\\", \\\"Once upon a time\\\") Returns documents if a string attributes starts with a substring. Ends With Query.endsWith(\\\"name\\\", \\\"happily ever after.\\\") Returns documents if a string attributes ends with a substring. Search Query.search(\\\"text\\\", \\\"key words\\\") Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. Order Descending Query.orderDesc(\\\"attribute\\\") Orders results in descending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. Order Ascending Query.orderAsc(\\\"attribute\\\") Orders results in ascending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. Limit Query.limit(25) Limits the number of results returned by the query. Used for pagination. If the limit query is not used, the limit defaults to 25 results. Offset Query.offset(0) Offset the results returned by skipping some of the results. Used for pagination. Cursor After Query.cursorAfter(\\\"62a7...f620\\\") Places the cursor after the specified resource ID. Used for pagination. Cursor Before Query.cursorBefore(\\\"62a7...a600\\\") Places the cursor before the specified resource ID. Used for pagination. \"]}, {\"level\": 2, \"title\": \"Building Queries\", \"body\": [\" Queries are passed to an endpoint through the queries parameter as an array of query strings, which can be generated using the Query class.\", \"Each query method is logically separated via AND operations. For OR operation, pass multiple values into the query method separated by commas. For example Query.equal('title', ['Avatar', 'Lord of the Rings']) will fetch the movies \\\"Avatar\\\" or \\\"Lord of the Rings\\\".\", \" Web import { Client, Databases, Query } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n\\ndatabases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.equal('title', ['Avatar', 'Lord of the Rings']),\\n Query.greaterThan('year', 1999)\\n ]\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n try {\\n final documents = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.equal('title', ['Avatar', 'Lord of the Rings']),\\n Query.greaterThan('year', 1999)\\n ]\\n );\\n } on AppwriteException catch(e) {\\n print(e);\\n }\\n} Android import io.appwrite.Client\\nimport io.appwrite.Query\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n val databases = Databases(client)\\n\\n try {\\n val documents = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = listOf(\\n Query.equal(\\\"title\\\", listOf(\\\"Avatar\\\", \\\"Lord of the Rings\\\")),\\n Query.greaterThan(\\\"year\\\", 1999)\\n )\\n )\\n } catch (e: AppwriteException) {\\n Log.e(\\\"Appwrite\\\", e.message)\\n }\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n do {\\n let documents = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.equal(\\\"title\\\", [\\\"Avatar\\\", \\\"Lord of the Rings\\\"]),\\n Query.greaterThan(\\\"year\\\", 1999)\\n ]\\n )\\n } catch {\\n print(error.localizedDescription)\\n }\\n} GraphQL query {\\n databasesListDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\"\\n queries: [\\\"equal(\\\\\\\"title\\\\\\\", [\\\\\\\"Avatar\\\\\\\", \\\\\\\"Lord of the Rings\\\\\\\"])\\\", \\\"greaterThan(\\\\\\\"year\\\\\\\", 1999)\\\"]\\n ) {\\n total\\n documents {\\n _id\\n data\\n }\\n }\\n} \"]}]", "metadata": {"source": "https://appwrite.io/docs/queries"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Queries \", \"body\": [\"Many list endpoints in Appwrite allow you to filter, sort, and paginate results using queries. Appwrite provides a common set of syntax to build queries.\"]}, {\"level\": 2, \"title\": \"Query Compatibility\", \"body\": [\"Each list endpoint supports different query operations. You can find the supported query methods and attributes in the References section of the Appwrite documentation.\"]}, {\"level\": 2, \"title\": \"Query Class\", \"body\": [\"Appwrite SDKs provide a Query class to help you build queries. The Query class has a method for each type of supported query.\", \" Query Method SDK Method Example Description Select Query.select([\\\"name\\\", \\\"title\\\"]) Select which attributes should be returned from a document. Equal Query.equal(\\\"title\\\", [\\\"Iron Man\\\"]) Returns document if attribute is equal to any value in the provided array. Not Equal Query.notEqual(\\\"title\\\", [\\\"Iron Man\\\"]) Returns document if attribute is not equal to any value in the provided array. Less Than Query.lessThan(\\\"score\\\", 10) Returns document if attribute is less than the provided value. Less Than or Equal Query.lessThanEqual(\\\"score\\\", 10) Returns document if attribute is less than or equal to the provided value. Greater Than Query.greaterThan(\\\"score\\\", 10) Returns document if attribute is greater than the provided value. Greater Than or Equal Query.greaterThanEqual(\\\"score\\\", 10) Returns document if attribute is greater than or equal to the provided value. Between Query.between(\\\"price\\\", 5, 10) Returns document if attribute value falls between the two values. The boundary values are inclusive and can be strings or numbers. Is Null Query.isNull(\\\"name\\\") Returns documents where attribute value is null. Is Not Null Query.isNotNull(\\\"name\\\") Returns documents where attribute value is not null. Starts With Query.startsWith(\\\"name\\\", \\\"Once upon a time\\\") Returns documents if a string attributes starts with a substring. Ends With Query.endsWith(\\\"name\\\", \\\"happily ever after.\\\") Returns documents if a string attributes ends with a substring. Search Query.search(\\\"text\\\", \\\"key words\\\") Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. Order Descending Query.orderDesc(\\\"attribute\\\") Orders results in descending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. Order Ascending Query.orderAsc(\\\"attribute\\\") Orders results in ascending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. Limit Query.limit(25) Limits the number of results returned by the query. Used for pagination. If the limit query is not used, the limit defaults to 25 results. Offset Query.offset(0) Offset the results returned by skipping some of the results. Used for pagination. Cursor After Query.cursorAfter(\\\"62a7...f620\\\") Places the cursor after the specified resource ID. Used for pagination. Cursor Before Query.cursorBefore(\\\"62a7...a600\\\") Places the cursor before the specified resource ID. Used for pagination. \"]}, {\"level\": 2, \"title\": \"Building Queries\", \"body\": [\" Queries are passed to an endpoint through the queries parameter as an array of query strings, which can be generated using the Query class.\", \"Each query method is logically separated via AND operations. For OR operation, pass multiple values into the query method separated by commas. For example Query.equal('title', ['Avatar', 'Lord of the Rings']) will fetch the movies \\\"Avatar\\\" or \\\"Lord of the Rings\\\".\", \" Web import { Client, Databases, Query } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n\\ndatabases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.equal('title', ['Avatar', 'Lord of the Rings']),\\n Query.greaterThan('year', 1999)\\n ]\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n try {\\n final documents = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.equal('title', ['Avatar', 'Lord of the Rings']),\\n Query.greaterThan('year', 1999)\\n ]\\n );\\n } on AppwriteException catch(e) {\\n print(e);\\n }\\n} Android import io.appwrite.Client\\nimport io.appwrite.Query\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n val databases = Databases(client)\\n\\n try {\\n val documents = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = listOf(\\n Query.equal(\\\"title\\\", listOf(\\\"Avatar\\\", \\\"Lord of the Rings\\\")),\\n Query.greaterThan(\\\"year\\\", 1999)\\n )\\n )\\n } catch (e: AppwriteException) {\\n Log.e(\\\"Appwrite\\\", e.message)\\n }\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n do {\\n let documents = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.equal(\\\"title\\\", [\\\"Avatar\\\", \\\"Lord of the Rings\\\"]),\\n Query.greaterThan(\\\"year\\\", 1999)\\n ]\\n )\\n } catch {\\n print(error.localizedDescription)\\n }\\n} GraphQL query {\\n databasesListDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\"\\n queries: [\\\"equal(\\\\\\\"title\\\\\\\", [\\\\\\\"Avatar\\\\\\\", \\\\\\\"Lord of the Rings\\\\\\\"])\\\", \\\"greaterThan(\\\\\\\"year\\\\\\\", 1999)\\\"]\\n ) {\\n total\\n documents {\\n _id\\n data\\n }\\n }\\n} \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/queries"}} \ No newline at end of file diff --git a/docs/ee43e608-1f0c-11ee-98fa-00155da08df7.json b/docs/4eed6c1c-4583-11ee-9922-f2ea36f81204.json similarity index 98% rename from docs/ee43e608-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eed6c1c-4583-11ee-9922-f2ea36f81204.json index 7de11a6..c97c0be 100644 --- a/docs/ee43e608-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eed6c1c-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Pagination \", \"body\": [\" Pagination is the process of dividing data into discrete pages. In Appwrite, it is achieved by using an offset or a cursor, which both come with their own use case and benefits.\"]}, {\"level\": 2, \"title\": \"Offset Pagination\", \"body\": [\" Using Query.limit() and Query.offset() you can achieve one of the most common approaches to pagination. With Query.limit() you can define to how many documents that can be returned from one request. The Query.offset() is simply the number of records you wish to skip before selecting records.\", \" Web import { Client, Databases, Query } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n \\n// Page 1\\nconst page1 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n);\\n\\n// Page 2\\nconst page2 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n final page1 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n );\\n\\n final page2 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n );\\n}\\n Android import io.appwrite.Client\\nimport io.appwrite.Query\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val databases = Databases(client)\\n\\n val page1 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n )\\n\\n val page2 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n )\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n let page1 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n )\\n\\n let page2 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n )\\n} \", \" The request gets slower as the number of records increases because the database has to read up to the offset number of rows to know where it should start selecting data. Also when there is data added in high frequency - the individual pages might skip results.\"]}, {\"level\": 2, \"title\": \"Cursor Pagination\", \"body\": [\" The cursor is a unique identifier for a document that points to where the next page should start. After reading a page of documents, pass the last document's ID into the Query.cursorAfter(lastId) query method to get the next page of documents. Pass the first document's ID into the Query.cursorBefore(firstId) query method to retrieve the previous page.\", \" Web import { Databases, Query } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\");\\n\\nconst databases = new Databases(client);\\n\\n// Page 1\\nconst page1 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n ]\\n);\\n\\nconst lastId = page1.documents[page1.documents.length - 1].$id;\\n\\n// Page 2\\nconst page2 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n Query.cursorAfter(lastId),\\n ]\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n final page1 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25)\\n ]\\n );\\n\\n final lastId = page1.documents[page1.documents.length - 1].$id;\\n\\n final page2 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25),\\n Query.cursorAfter(lastId)\\n ]\\n );\\n\\n}\\n Android import android.util.Log\\nimport io.appwrite.AppwriteException\\nimport io.appwrite.Client\\nimport io.appwrite.Query\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val databases = Databases(client)\\n\\n val page1 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25)\\n ]\\n )\\n\\n val lastId = page1.documents[page1.documents.size - 1].$id\\n\\n val page2 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25),\\n Query.cursorAfter(lastId)\\n ]\\n )\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n let page1 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25)\\n ]\\n )\\n\\n let lastId = page1.documents[page1.documents.count - 1].$id\\n\\n let page2 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25),\\n Query.cursorAfter(lastId)\\n ]\\n )\\n} \"]}]", "metadata": {"source": "https://appwrite.io/docs/pagination"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Pagination \", \"body\": [\" Pagination is the process of dividing data into discrete pages. In Appwrite, it is achieved by using an offset or a cursor, which both come with their own use case and benefits.\"]}, {\"level\": 2, \"title\": \"Offset Pagination\", \"body\": [\" Using Query.limit() and Query.offset() you can achieve one of the most common approaches to pagination. With Query.limit() you can define to how many documents that can be returned from one request. The Query.offset() is simply the number of records you wish to skip before selecting records.\", \" Web import { Client, Databases, Query } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n \\n// Page 1\\nconst page1 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n);\\n\\n// Page 2\\nconst page2 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n final page1 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n );\\n\\n final page2 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n );\\n}\\n Android import io.appwrite.Client\\nimport io.appwrite.Query\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val databases = Databases(client)\\n\\n val page1 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n )\\n\\n val page2 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n )\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n let page1 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25),\\n Query.offset(0)\\n ]\\n )\\n\\n let page2 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25),\\n Query.offset(25)\\n ]\\n )\\n} \", \" The request gets slower as the number of records increases because the database has to read up to the offset number of rows to know where it should start selecting data. Also when there is data added in high frequency - the individual pages might skip results.\"]}, {\"level\": 2, \"title\": \"Cursor Pagination\", \"body\": [\" The cursor is a unique identifier for a document that points to where the next page should start. After reading a page of documents, pass the last document's ID into the Query.cursorAfter(lastId) query method to get the next page of documents. Pass the first document's ID into the Query.cursorBefore(firstId) query method to retrieve the previous page.\", \" Web import { Databases, Query } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\");\\n\\nconst databases = new Databases(client);\\n\\n// Page 1\\nconst page1 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n ]\\n);\\n\\nconst lastId = page1.documents[page1.documents.length - 1].$id;\\n\\n// Page 2\\nconst page2 = await databases.listDocuments(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n [\\n Query.limit(25),\\n Query.cursorAfter(lastId),\\n ]\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n final page1 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25)\\n ]\\n );\\n\\n final lastId = page1.documents[page1.documents.length - 1].$id;\\n\\n final page2 = await databases.listDocuments(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n queries: [\\n Query.limit(25),\\n Query.cursorAfter(lastId)\\n ]\\n );\\n\\n}\\n Android import android.util.Log\\nimport io.appwrite.AppwriteException\\nimport io.appwrite.Client\\nimport io.appwrite.Query\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val databases = Databases(client)\\n\\n val page1 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25)\\n ]\\n )\\n\\n val lastId = page1.documents[page1.documents.size - 1].$id\\n\\n val page2 = databases.listDocuments(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n queries = [\\n Query.limit(25),\\n Query.cursorAfter(lastId)\\n ]\\n )\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n let page1 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25)\\n ]\\n )\\n\\n let lastId = page1.documents[page1.documents.count - 1].$id\\n\\n let page2 = try await databases.listDocuments(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n queries: [\\n Query.limit(25),\\n Query.cursorAfter(lastId)\\n ]\\n )\\n} \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/pagination"}} \ No newline at end of file diff --git a/docs/ee43e888-1f0c-11ee-98fa-00155da08df7.json b/docs/4eed72f2-4583-11ee-9922-f2ea36f81204.json similarity index 96% rename from docs/ee43e888-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eed72f2-4583-11ee-9922-f2ea36f81204.json index de32660..e687673 100644 --- a/docs/ee43e888-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eed72f2-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Webhooks \", \"body\": [\"Webhooks allow you to build or set up integrations which subscribe to certain events on Appwrite. When one of those events is triggered, we'll send an HTTP POST payload to the webhook's configured URL. Webhooks can be used to purge cache from CDN, calculate data or send a Slack notification. You're only limited by your imagination.\"]}, {\"level\": 2, \"title\": \"Add Your Webhook\", \"body\": [\"You can set your webhook by adding it from your Appwrite project dashboard. You can access your webhooks settings from your project dashboard or on the left navigation panel. Click the 'Add Webhook' button and choose your webhook name and the events that should trigger it. You can also set an optional basic HTTP authentication username and password to protect your endpoint from unauthorized access. \"]}, {\"level\": 2, \"title\": \"Payload\", \"body\": [\"Each event type has a specific payload format with the relevant event information. All event payloads mirror the payloads for the API payload which parallel to the event types.\"]}, {\"level\": 2, \"title\": \"Headers\", \"body\": [\"HTTP requests made to your webhook's configured URL endpoint will contain several special headers:\", \" Header Description X-Appwrite-Webhook-Id version >= 0.7 The ID of the Webhook who triggered the event. X-Appwrite-Webhook-Events Names of the events that triggered this delivery. X-Appwrite-Webhook-Name Name of the webhook as specified in your app settings and events list. X-Appwrite-Webhook-User-Id version >= 0.7 The user ID of the user who triggered the event. Returns an empty string if an API key triggered the event.Note that events like `account.create` or `account.sessions.create` are performed by guest users and will not return any user ID. If you still need the user ID for these events, you can find it in the event payload. X-Appwrite-Webhook-Project-Id version >= 0.7 The ID of the project who owns the Webhook and API call. X-Appwrite-Webhook-Signature version >= 0.15.0 The HMAC-SHA1 signature of the payload. This is used to verify the authenticity of the payload. User-Agent Each request made by Appwrite will be 'Appwrite-Server'. \"]}, {\"level\": 2, \"title\": \"Verification\", \"body\": [\"Webhooks can be verified by using the X-Appwrite-Webhook-Signature header. This is the HMAC-SHA1\\nsignature of the payload. You can find the signature key in your webhooks properties in the dashboard. To generate this hash you append\\nthe payload to the end of webhook URL (make sure there are no spaces in between) and then use the HMAC-SHA1 algorithm to generate the signature.\\nAfter you've generated the signature, compare it to the \\\"X-Appwrite-Webhook-Signature\\\" header value. If they match, the payload is valid and you can trust it came from\\nyour Appwrite instance. \"]}]", "metadata": {"source": "https://appwrite.io/docs/webhooks"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Webhooks \", \"body\": [\"Webhooks allow you to build or set up integrations which subscribe to certain events on Appwrite. When one of those events is triggered, we'll send an HTTP POST payload to the webhook's configured URL. Webhooks can be used to purge cache from CDN, calculate data or send a Slack notification. You're only limited by your imagination.\"]}, {\"level\": 2, \"title\": \"Add Your Webhook\", \"body\": [\"You can set your webhook by adding it from your Appwrite project dashboard. You can access your webhooks settings from your project dashboard or on the left navigation panel. Click the 'Add Webhook' button and choose your webhook name and the events that should trigger it. You can also set an optional basic HTTP authentication username and password to protect your endpoint from unauthorized access. \"]}, {\"level\": 2, \"title\": \"Payload\", \"body\": [\"Each event type has a specific payload format with the relevant event information. All event payloads mirror the payloads for the API payload which parallel to the event types.\"]}, {\"level\": 2, \"title\": \"Headers\", \"body\": [\"HTTP requests made to your webhook's configured URL endpoint will contain several special headers:\", \" Header Description X-Appwrite-Webhook-Id version >= 0.7 The ID of the Webhook who triggered the event. X-Appwrite-Webhook-Events Names of the events that triggered this delivery. X-Appwrite-Webhook-Name Name of the webhook as specified in your app settings and events list. X-Appwrite-Webhook-User-Id version >= 0.7 The user ID of the user who triggered the event. Returns an empty string if an API key triggered the event.Note that events like `account.create` or `account.sessions.create` are performed by guest users and will not return any user ID. If you still need the user ID for these events, you can find it in the event payload. X-Appwrite-Webhook-Project-Id version >= 0.7 The ID of the project who owns the Webhook and API call. X-Appwrite-Webhook-Signature version >= 0.15.0 The HMAC-SHA1 signature of the payload. This is used to verify the authenticity of the payload. User-Agent Each request made by Appwrite will be 'Appwrite-Server'. \"]}, {\"level\": 2, \"title\": \"Verification\", \"body\": [\"Webhooks can be verified by using the X-Appwrite-Webhook-Signature header. This is the HMAC-SHA1\\nsignature of the payload. You can find the signature key in your webhooks properties in the dashboard. To generate this hash you append\\nthe payload to the end of webhook URL (make sure there are no spaces in between) and then use the HMAC-SHA1 algorithm to generate the signature.\\nAfter you've generated the signature, compare it to the \\\"X-Appwrite-Webhook-Signature\\\" header value. If they match, the payload is valid and you can trust it came from\\nyour Appwrite instance. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/webhooks"}} \ No newline at end of file diff --git a/docs/ee43ea4a-1f0c-11ee-98fa-00155da08df7.json b/docs/4eed7932-4583-11ee-9922-f2ea36f81204.json similarity index 97% rename from docs/ee43ea4a-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eed7932-4583-11ee-9922-f2ea36f81204.json index 5089037..25b88fc 100644 --- a/docs/ee43ea4a-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eed7932-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Custom Domains \", \"body\": [\"Appwrite custom domains feature allows you to use your self-owned domain name as your Appwrite API endpoint. A recent change made in modern browsers will not allow your web app to use 3rd party cookies. This change is done to protect your users' privacy from malicious web tracking services.\", \"When accessing Appwrite from a 3rd party domain, like appwrite.io or example.com, some browsers will treat our secure cookies as 3rd party cookies and block them, as a fallback Appwrite will store your users' sessions on the browser localStorage.\", \"Using localStorage is very convenient to help you get started quickly with Appwrite, but it is not the best practice for your users' security. The browser localStorage can't protect your users' sessions from being hijacked by a 3rd party script or an XSS vulnerability in your web app.\", \"To overcome these issues and make sure your web application works securely on all browsers, Appwrite allows you to access the Appwrite API using your own private custom domain. When accessing Appwrite from the same domain as the one your app uses, Appwrite cookies will no longer be treated as 3rd party cookies by any browser and will store your users' sessions securely.\", \"For example, if your app runs on\\u00a0my-app.com,\\u00a0you can set the subdomain\\u00a0appwrite.my-app.com\\u00a0to access the Appwrite API. This will allow browsers to respect the Appwrite sessions cookies as they are set on the same domain as your app.\"]}, {\"level\": 2, \"title\": \"Add Your Domain\", \"body\": [\"You can set your domain name by adding it to your Appwrite project settings page under the 'Custom Domains' tab. After you added your new domain to your project settings from the dashboard, you will need to create a new CNAME DNS record at your DNS provider dashboard.\"]}, {\"level\": 2, \"title\": \"Add a CNAME Record\", \"body\": [\"A CNAME record (or a Canonical Name record) is a type of resource record in the Domain Name System (DNS), which maps one domain name (an alias) to another.\", \"Every DNS host has its own way of updating DNS settings, and, unfortunately, their dashboard interfaces usually aren't the most intuitive. We recommend that you read the help documentation of your DNS host, also do not hesitate to contact their support for help with their interface and settings.\", \"Below, you'll find a list of registrars and links to their DNS setting documentation. If your domain provider isn't listed above, please contact us, and we'll include their settings as well.\", \" Provider Settings IONOS \\u00a0 (ionos.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 101domain \\u00a0 (101domain.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 123 Reg \\u00a0 (123-reg.co.uk) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 AWS Route 53 \\u00a0 (aws.amazon.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Alfahosting \\u00a0 (alfahosting.de) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Binero \\u00a0 (binero.se) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Settings\\u00a0\\u00a0\\u00a0\\u00a0 Bluehost \\u00a0 (bluehost.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Settings\\u00a0\\u00a0\\u00a0\\u00a0 ClouDNS \\u00a0 (cloudns.net) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Cloudflare \\u00a0 (cloudflare.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Crazydomains \\u00a0 (crazydomains.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 DNS Made Easy \\u00a0 (dnsmadeeasy.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 DNSimple \\u00a0 (dnsimple.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 DigitalOcean \\u00a0 (digitalocean.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Settings\\u00a0\\u00a0\\u00a0\\u00a0 DreamHost \\u00a0 (dreamhost.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Freeparking \\u00a0 (freeparking.co.nz) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Gandi \\u00a0 (gandi.net) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Godaddy \\u00a0 (godaddy.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Google Domains \\u00a0 (domains.google) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Host Europe \\u00a0 (hosteurope.de) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Hover \\u00a0 (hover.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Media Temple \\u00a0 (mediatemple.net) Settings\\u00a0\\u00a0\\u00a0\\u00a0 NS1 \\u00a0 (ns1.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Name.com \\u00a0 (name.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 NameSilo \\u00a0 (namesilo.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Namecheap \\u00a0 (namecheap.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Network Solutions \\u00a0 (networksolutions.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 OVH \\u00a0 (ovh.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 One.com \\u00a0 (one.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Wix \\u00a0 (wix.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Yahoo \\u00a0 (smallbusiness.yahoo.net) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 enom \\u00a0 (enom.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 iPage \\u00a0 (ipage.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 inmotion \\u00a0 (inmotionhosting.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 iwantmyname \\u00a0 (iwantmyname.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Settings\\u00a0\\u00a0\\u00a0\\u00a0 \"]}, {\"level\": 2, \"title\": \"Confirm and Verify Your Domain\", \"body\": [\"Once you added your new CNAME record to your DNS settings, you will need to verify your new domain name from your Appwrite console. Enter your custom domains tab from your project settings, click the DNS Settings link and click on the 'Confirm and Verify\\\" button. If everything went well, Appwrite will approve your domain and generate a new SSL certificate for it in the background.\"]}, {\"level\": 2, \"title\": \"Enjoy your Free SSL Certificate\", \"body\": [\"Appwrite uses Let's Encrypt service to generate free and automated SSL certificates for your custom domains. Once your domain is verified, it will take the Appwrite server a few seconds to create a new SSL certificate for it. Once done, you will see your domain TLS setting marked as 'Enabled' in your Appwrite dashboard, and you will be able to connect the Appwrite API using your new domain.\"]}]", "metadata": {"source": "https://appwrite.io/docs/custom-domains"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Custom Domains \", \"body\": [\"Appwrite custom domains feature allows you to use your self-owned domain name as your Appwrite API endpoint. A recent change made in modern browsers will not allow your web app to use 3rd party cookies. This change is done to protect your users' privacy from malicious web tracking services.\", \"When accessing Appwrite from a 3rd party domain, like appwrite.io or example.com, some browsers will treat our secure cookies as 3rd party cookies and block them, as a fallback Appwrite will store your users' sessions on the browser localStorage.\", \"Using localStorage is very convenient to help you get started quickly with Appwrite, but it is not the best practice for your users' security. The browser localStorage can't protect your users' sessions from being hijacked by a 3rd party script or an XSS vulnerability in your web app.\", \"To overcome these issues and make sure your web application works securely on all browsers, Appwrite allows you to access the Appwrite API using your own private custom domain. When accessing Appwrite from the same domain as the one your app uses, Appwrite cookies will no longer be treated as 3rd party cookies by any browser and will store your users' sessions securely.\", \"For example, if your app runs on\\u00a0my-app.com,\\u00a0you can set the subdomain\\u00a0appwrite.my-app.com\\u00a0to access the Appwrite API. This will allow browsers to respect the Appwrite sessions cookies as they are set on the same domain as your app.\"]}, {\"level\": 2, \"title\": \"Add Your Domain\", \"body\": [\"You can set your domain name by adding it to your Appwrite project settings page under the 'Custom Domains' tab. After you added your new domain to your project settings from the dashboard, you will need to create a new CNAME DNS record at your DNS provider dashboard.\"]}, {\"level\": 2, \"title\": \"Add a CNAME Record\", \"body\": [\"A CNAME record (or a Canonical Name record) is a type of resource record in the Domain Name System (DNS), which maps one domain name (an alias) to another.\", \"Every DNS host has its own way of updating DNS settings, and, unfortunately, their dashboard interfaces usually aren't the most intuitive. We recommend that you read the help documentation of your DNS host, also do not hesitate to contact their support for help with their interface and settings.\", \"Below, you'll find a list of registrars and links to their DNS setting documentation. If your domain provider isn't listed above, please contact us, and we'll include their settings as well.\", \" Provider Settings IONOS \\u00a0 (ionos.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 101domain \\u00a0 (101domain.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 123 Reg \\u00a0 (123-reg.co.uk) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 AWS Route 53 \\u00a0 (aws.amazon.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Alfahosting \\u00a0 (alfahosting.de) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Binero \\u00a0 (binero.se) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Settings\\u00a0\\u00a0\\u00a0\\u00a0 Bluehost \\u00a0 (bluehost.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Settings\\u00a0\\u00a0\\u00a0\\u00a0 ClouDNS \\u00a0 (cloudns.net) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Cloudflare \\u00a0 (cloudflare.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Crazydomains \\u00a0 (crazydomains.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 DNS Made Easy \\u00a0 (dnsmadeeasy.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 DNSimple \\u00a0 (dnsimple.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 DigitalOcean \\u00a0 (digitalocean.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Settings\\u00a0\\u00a0\\u00a0\\u00a0 DreamHost \\u00a0 (dreamhost.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Freeparking \\u00a0 (freeparking.co.nz) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Gandi \\u00a0 (gandi.net) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Godaddy \\u00a0 (godaddy.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Google Domains \\u00a0 (domains.google) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Host Europe \\u00a0 (hosteurope.de) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Hover \\u00a0 (hover.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Media Temple \\u00a0 (mediatemple.net) Settings\\u00a0\\u00a0\\u00a0\\u00a0 NS1 \\u00a0 (ns1.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Name.com \\u00a0 (name.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 NameSilo \\u00a0 (namesilo.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 Namecheap \\u00a0 (namecheap.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Network Solutions \\u00a0 (networksolutions.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 OVH \\u00a0 (ovh.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 One.com \\u00a0 (one.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Wix \\u00a0 (wix.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Yahoo \\u00a0 (smallbusiness.yahoo.net) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 enom \\u00a0 (enom.com) Settings\\u00a0\\u00a0\\u00a0\\u00a0 iPage \\u00a0 (ipage.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 inmotion \\u00a0 (inmotionhosting.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 iwantmyname \\u00a0 (iwantmyname.com) A Record\\u00a0\\u00a0\\u00a0\\u00a0 CNAME Record\\u00a0\\u00a0\\u00a0\\u00a0 Settings\\u00a0\\u00a0\\u00a0\\u00a0 \"]}, {\"level\": 2, \"title\": \"Confirm and Verify Your Domain\", \"body\": [\"Once you added your new CNAME record to your DNS settings, you will need to verify your new domain name from your Appwrite Console. Enter your custom domains tab from your project settings, click the DNS Settings link and click on the 'Confirm and Verify\\\" button. If everything went well, Appwrite will approve your domain and generate a new SSL certificate for it in the background.\"]}, {\"level\": 2, \"title\": \"Enjoy your Free SSL Certificate\", \"body\": [\"Appwrite uses Let's Encrypt service to generate free and automated SSL certificates for your custom domains. Once your domain is verified, it will take the Appwrite server a few seconds to create a new SSL certificate for it. Once done, you will see your domain TLS setting marked as 'Enabled' in your Appwrite dashboard, and you will be able to connect the Appwrite API using your new domain.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/custom-domains"}} \ No newline at end of file diff --git a/docs/4eed8080-4583-11ee-9922-f2ea36f81204.json b/docs/4eed8080-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..22194df --- /dev/null +++ b/docs/4eed8080-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Email Templates \", \"body\": [\"Appwrite uses emails to communicate with users to perform authentication and verification actions. Emails can be customized to fit your app's design and voice.\", \" Each Appwrite project can have its own set of unique templates. Templates also support localization, so every template can be written in multiple languages and served depending on the configured locale.\"]}, {\"level\": 2, \"title\": \"Customize Templates\", \"body\": [\"You can customize email templates for each of your projects in the Appwrite Console. \", \" Custom SMTP Server Required The built-in email service does not support custom email templates to prevent malicious templates. Configure a custom SMTP server to enable custom email templates.\", \" In your project, navigate to the Auth service. Under the Auth service, navigate to the Templates tab. Expand the email template you want to edit. Select the Template language. You can have a different template for each language your app supports. Update the email template fields and click **Update** to save your changes.\"]}, {\"level\": 2, \"title\": \"Email Templates\", \"body\": [\"You can customize the email templates for account verification, magic-url authentication, password resets, and user invites.\"]}, {\"level\": 3, \"title\": \"Email Template Components\", \"body\": [\"Each email templates has the following components that you can customize.\", \" Component Description Sender name Readers will see this as a display name of the sender. Sender email Readers will see this as a display email of the sender. This email must be authenticated on the SMTP provider you've configured, otherwise it will be delivered to the spam folder. This usually means the email must end with the same domain as your SMTP username. Reply to Readers will reply to this email address instead of the sender address. You can leave this field empty, and the sender email will be used automatically. Subject The title of the email. Message The body of the email in HTML format. You can find the variables available in the Email Template Syntax section. \"]}, {\"level\": 3, \"title\": \"Email Template Syntax\", \"body\": [\"Variables can be used in email templates to dynamically construct unique emails for each reader. These variables can only be used in the Message field of the email template.\", \" Variable Description {{project}} The project name. {{team}} The project team's name. {{user}} The name of the user receiving the email. This variable is not available in the Magic URL template, as there might not be a user yet. {{redirect}} The URL for the user to complete the email template's action. \"]}, {\"level\": 3, \"title\": \"Email Template Examples\", \"body\": [\"Here's an example of using these variables in a template.\", \" \\n<html>\\n\\n<head>\\n <style>\\n ... your style here\\n \\n\\n\\n<body style=\\\"direction: ltr\\\">\\n\\n<div style=\\\"max-width:650px; word-wrap: break-word; overflow-wrap: break-word;\\n word-break: break-all; margin:0 auto;\\\">\\n <table style=\\\"margin-top: 32px\\\">\\n <tr>\\n <td>\\n <h1>\\n {{subject}}\\n \\n \\n \\n \\n\\n <table style=\\\"margin-top: 40px\\\">\\n <tr>\\n <td>\\n <p>Hello

\\n\\n <p>Follow this link to reset your {{project}} password.

\\n\\n <a href=\\\"{{redirect}}\\\" target=\\\"_blank\\\">{{redirect}}\\n\\n <p><br />If you didn't ask to reset your password, you can ignore this message.

\\n <br />\\n\\n <p>Thanks\\n <br />\\n {{project}} team\\n

\\n \\n \\n \\n\\n\\n\\n\\n\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/email-and-sms-templates"}} \ No newline at end of file diff --git a/docs/ee43ec66-1f0c-11ee-98fa-00155da08df7.json b/docs/4eed86ca-4583-11ee-9922-f2ea36f81204.json similarity index 97% rename from docs/ee43ec66-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eed86ca-4583-11ee-9922-f2ea36f81204.json index 153c670..0c10dbb 100644 --- a/docs/ee43ec66-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eed86ca-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Response Codes \", \"body\": [\"Appwrite uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, invalid input, etc.). Codes in the 5xx range indicate an error with the Appwrite server, but these are rare.\", \" Code Text Description 200 OK Success! 201 Created The requested resource has been created successfully. 202 Accepted The requested change has been accepted for processing but has not been completed. 204 No Content The server has successfully fulfilled the request and that there is no additional content to send in the response payload body. This status will usually return on successful delete operations. 301 Moved Permanently The URL of the requested resource has been changed permanently. The new URL is given in the response. 304 Not Modified There was no new data to return. 400 Bad Request The request was invalid or cannot be otherwise served. An accompanying error message will explain further. Requests with wrong or invalid input will yield this response. 401 Unauthorized Missing or incorrect authentication credentials can happen when the API key or user permission is not sufficient. 403 Forbidden The request is understood, but it has been refused, or access is not allowed. An accompanying error message will explain why. Make sure to register your app in your project's dashboard platform list. 404 Not Found The URI requested is invalid or the resource requested, such as a user, does not exist. 409 Conflict This response is sent when a request conflicts with the current state of the server. This status code will usually appear when you're trying to create an already existing resource. 413 Payload Too Large This indicates that the request entity is larger than limits defined by server. This status code will usually appear happen when uploading a file or function that is too large 416 Invalid Range Invalid value in the range or content-range headers. Usually returned while uploading or downloading files using range header but the provided range value is not valid. 429 Too Many Requests Returned in when a request cannot be served due to the application's rate limit having been exhausted for the resource. See Rate Limits 500 Internal Server Error Something is broken. Contact our team, or raise a GitHub issue. 501 Not Implemented The feature is not implemented. Usually returned when the project owner has disabled an auth method or an entire service. 503 Service Unavailable The Appwrite servers are up but overloaded with requests. Try again later. 504 Gateway timeout The Appwrite servers are up, but the request couldn't be serviced due to some failure within the stack. Try again later. \"]}, {\"level\": 2, \"title\": \"Error Messages\", \"body\": [\"When the Appwrite APIs return error messages, it does so in JSON format. For example, an error might look like this:\", \" {\\n \\\"message\\\": \\\"Invalid id: Parameter must be a valid number\\\",\\n \\\"type\\\": \\\"argument_invalid\\\",\\n \\\"code\\\": 400\\n}\\n\"]}]", "metadata": {"source": "https://appwrite.io/docs/response-codes"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Response Codes \", \"body\": [\"Appwrite uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, invalid input, etc.). Codes in the 5xx range indicate an error with the Appwrite server, but these are rare.\", \" Code Text Description 200 OK Success! 201 Created The requested resource has been created successfully. 202 Accepted The requested change has been accepted for processing but has not been completed. 204 No Content The server has successfully fulfilled the request and that there is no additional content to send in the response payload body. This status will usually return on successful delete operations. 301 Moved Permanently The URL of the requested resource has been changed permanently. The new URL is given in the response. 304 Not Modified There was no new data to return. 400 Bad Request The request was invalid or cannot be otherwise served. An accompanying error message will explain further. Requests with wrong or invalid input will yield this response. 401 Unauthorized Missing or incorrect authentication credentials can happen when the API key or user permission is not sufficient. 403 Forbidden The request is understood, but it has been refused, or access is not allowed. An accompanying error message will explain why. Make sure to register your app in your project's dashboard platform list. 404 Not Found The URI requested is invalid or the resource requested, such as a user, does not exist. 409 Conflict This response is sent when a request conflicts with the current state of the server. This status code will usually appear when you're trying to create an already existing resource. 413 Payload Too Large This indicates that the request entity is larger than limits defined by server. This status code will usually appear happen when uploading a file or function that is too large 416 Invalid Range Invalid value in the range or content-range headers. Usually returned while uploading or downloading files using range header but the provided range value is not valid. 429 Too Many Requests Returned in when a request cannot be served due to the application's rate limit having been exhausted for the resource. See Rate Limits 500 Internal Server Error Something is broken. Contact our team, or raise a GitHub issue. 501 Not Implemented The feature is not implemented. Usually returned when the project owner has disabled an auth method or an entire service. 503 Service Unavailable The Appwrite servers are up but overloaded with requests. Try again later. 504 Gateway timeout The Appwrite servers are up, but the request couldn't be serviced due to some failure within the stack. Try again later. \"]}, {\"level\": 2, \"title\": \"Error Messages\", \"body\": [\"When the Appwrite APIs return error messages, it does so in JSON format. For example, an error might look like this:\", \" {\\n \\\"message\\\": \\\"Invalid id: Parameter must be a valid number\\\",\\n \\\"type\\\": \\\"argument_invalid\\\",\\n \\\"code\\\": 400\\n}\\n\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/response-codes"}} \ No newline at end of file diff --git a/docs/ee43ee1e-1f0c-11ee-98fa-00155da08df7.json b/docs/4eed8da0-4583-11ee-9922-f2ea36f81204.json similarity index 97% rename from docs/ee43ee1e-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eed8da0-4583-11ee-9922-f2ea36f81204.json index 44584a2..c4c2f0c 100644 --- a/docs/ee43ee1e-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eed8da0-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Rate Limits \", \"body\": [\"Some of Appwrite's API endpoints have a rate limit to avoid abuse or brute-force attacks against Appwrite's REST API. Each Appwrite route documentation has information about any rate limits that might apply to them.\", \"Rate limits only apply to Client SDKs. Rate limits do not apply when accessing Appwrite with a Server SDK authenticated using an API key.\", \"You can check the returned HTTP headers of any API request to see your current rate limit status:\", \" HTTP/1.1 200\\nDate: Mon, 01 Jul 2013 17:27:06 GMT\\nStatus: 200\\nX-RateLimit-Limit: 60\\nX-RateLimit-Remaining: 56\\nX-RateLimit-Reset: 1372700873\\n\", \"The headers tell you everything you need to know about your current rate limit status:\", \" Header Description X-RateLimit-Limit The maximum number of requests that the consumer is permitted to make per hour. X-RateLimit-Remaining The number of requests remaining in the current rate limit window. X-RateLimit-Reset The time at which the current rate limit window resets in UTC epoch seconds. \", \"If you need the time in a different format, any modern programming language can get the job done. For example, if you open up the console on your web browser, you can easily get the reset time as a JavaScript Date object, You can also read more about Unix Time.\", \" new Date(1372700873 * 1000) // => Mon Jul 01 2013 13:47:53 GMT-0400 (EDT)\", \"Once you go over the rate limit you will receive an error response:\", \" HTTP/1.1 429\\nDate: Tue, 20 Aug 2013 14:50:41 GMT\\nStatus: 429\\nX-RateLimit-Limit: 60\\nX-RateLimit-Remaining: 0\\nX-RateLimit-Reset: 1377013266\\n{\\n \\\"message\\\": \\\"Too many requests\\\",\\n \\\"code\\\": 429\\n}\\n\"]}]", "metadata": {"source": "https://appwrite.io/docs/rate-limits"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Rate Limits \", \"body\": [\"Some of Appwrite's API endpoints have a rate limit to avoid abuse or brute-force attacks against Appwrite's REST API. Each Appwrite route documentation has information about any rate limits that might apply to them.\", \"Rate limits only apply to Client SDKs. Rate limits do not apply when accessing Appwrite with a Server SDK authenticated using an API key.\", \"You can check the returned HTTP headers of any API request to see your current rate limit status:\", \" HTTP/1.1 200\\nDate: Mon, 01 Jul 2013 17:27:06 GMT\\nStatus: 200\\nX-RateLimit-Limit: 60\\nX-RateLimit-Remaining: 56\\nX-RateLimit-Reset: 1372700873\\n\", \"The headers tell you everything you need to know about your current rate limit status:\", \" Header Description X-RateLimit-Limit The maximum number of requests that the consumer is permitted to make per hour. X-RateLimit-Remaining The number of requests remaining in the current rate limit window. X-RateLimit-Reset The time at which the current rate limit window resets in UTC epoch seconds. \", \"If you need the time in a different format, any modern programming language can get the job done. For example, if you open up the console on your web browser, you can easily get the reset time as a JavaScript Date object, You can also read more about Unix Time.\", \" new Date(1372700873 * 1000) // => Mon Jul 01 2013 13:47:53 GMT-0400 (EDT)\", \"Once you go over the rate limit you will receive an error response:\", \" HTTP/1.1 429\\nDate: Tue, 20 Aug 2013 14:50:41 GMT\\nStatus: 429\\nX-RateLimit-Limit: 60\\nX-RateLimit-Remaining: 0\\nX-RateLimit-Reset: 1377013266\\n{\\n \\\"message\\\": \\\"Too many requests\\\",\\n \\\"code\\\": 429\\n}\\n\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/rate-limits"}} \ No newline at end of file diff --git a/docs/ee43efae-1f0c-11ee-98fa-00155da08df7.json b/docs/4eed93a4-4583-11ee-9922-f2ea36f81204.json similarity index 60% rename from docs/ee43efae-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eed93a4-4583-11ee-9922-f2ea36f81204.json index 8f6b630..d3cb908 100644 --- a/docs/ee43efae-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eed93a4-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Self-Hosting \", \"body\": [\"Appwrite was designed from the ground up with self-hosting in mind. You can install and run Appwrite on any operating system that can run a Docker CLI. Self-hosted Appwrite instances can be configured flexibly with access to the same features found on Appwrite Cloud.\"]}, {\"level\": 2, \"title\": \"System Requirements\", \"body\": [\"Appwrite is designed to run well on both small and large deployments. The minimum requirements to run Appwrite are as little as 1 CPU core and 2GB of RAM, and an operating system that supports Docker.\", \"Appwrite requires Docker Compose Version 2. To install Appwrite, make sure your Docker installation is updated to support Composer V2.\", \" Upgrading From Older Versions If you are migrating from an older version of Appwrite, you need to follow the migration instructions.\"]}, {\"level\": 2, \"title\": \"Install with Docker\", \"body\": [\"The easiest way to start running your Appwrite server is by running our Docker installer tool from your terminal. Before running the installation command, make sure you have Docker CLI installed on your host machine.\", \"You will be prompted to configure the following during the setup command:\", \" Your Appwrite instance's HTTP and HTTPS ports. Your Appwrite instance's secret key which used to encrypt sensitive data. Your Appwrite instance's main hostname. Appwrite will generate a certificate using this hostname. Your Appwrite instance's DNS A record hostname. Typically set to the same value as your Appwrite instance's hostname.\"]}, {\"level\": 3, \"title\": \"Unix\", \"body\": [\" docker run -it --rm \\\\\\n --volume /var/run/docker.sock:/var/run/docker.sock \\\\\\n --volume \\\"$(pwd)\\\"/appwrite:/usr/src/code/appwrite:rw \\\\\\n --entrypoint=\\\"install\\\" \\\\\\n appwrite/appwrite:1.3.7\"]}, {\"level\": 3, \"title\": \"Windows\", \"body\": [\"Hyper-V and Containers Windows features must be enabled to run Appwrite on Windows with Docker. If you don't have these features available, you can install Docker Desktop which uses Virtualbox to run Appwrite on a Virtual Machine.\", \" CMD docker run -it --rm ^\\n --volume //var/run/docker.sock:/var/run/docker.sock ^\\n --volume \\\"%cd%\\\"/appwrite:/usr/src/code/appwrite:rw ^\\n --entrypoint=\\\"install\\\" ^\\n appwrite/appwrite:1.3.7 PowerShell docker run -it --rm `\\n --volume /var/run/docker.sock:/var/run/docker.sock `\\n --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `\\n --entrypoint=\\\"install\\\" `\\n appwrite/appwrite:1.3.7 \"]}, {\"level\": 2, \"title\": \"One-Click Setups\", \"body\": [\" In addition to running Appwrite locally, you can also launch Appwrite using a pre-configured setup. This allows you to get up and running with Appwrite quickly without installing Docker on your local machine.\", \"Choose from one of the providers below:\", \" Provider DigitalOcean Click to Install Gitpod Click to Install \"]}, {\"level\": 2, \"title\": \"Next Steps\", \"body\": [\"Self-hosting Appwrite gives you more configurable options. You can customize Appwrite with your choice of S3 compatible storage adaptors, email and SMS providers, functions runtimes, and more.\", \" Learn about configuring Appwrite\", \"Self-hosted Appwrite instances can be made production ready. To run Appwrite successfully in a production environment, you should follow a few basic concepts and best practices.\", \" Learn about Appwrite in production\"]}, {\"level\": 2, \"title\": \"Manual (using docker-compose.yml)\", \"body\": [\"For advanced Docker users, the manual installation might seem more familiar. To set up Appwrite manually, download the Appwrite base docker-compose.yml and .env files, then move them inside a directory named appwrite. After the download completes, update the different environment variables as you wish in the .env file and start the Appwrite stack using the following Docker command:\", \" docker compose up -d --remove-orphans\", \"Once the Docker installation completes, go to your machine's hostname or IP address on your browser to access the Appwrite console. Please note that on hosts that are not Linux-native, the server might take a few minutes to start after installation completes.\"]}, {\"level\": 2, \"title\": \"Stop\", \"body\": [\"You can stop your Appwrite containers by using the following command executed from the same directory as your docker-compose.yml file.\", \" docker compose stop\"]}]", "metadata": {"source": "https://appwrite.io/docs/self-hosting"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Self-Hosting \", \"body\": [\"Appwrite was designed from the ground up with self-hosting in mind. You can install and run Appwrite on any operating system that can run a Docker CLI. Self-hosted Appwrite instances can be configured flexibly with access to the same features found on Appwrite Cloud.\"]}, {\"level\": 2, \"title\": \"System Requirements\", \"body\": [\"Appwrite is designed to run well on both small and large deployments. The minimum requirements to run Appwrite are as little as 1 CPU core and 2GB of RAM, and an operating system that supports Docker.\", \"Appwrite requires Docker Compose Version 2. To install Appwrite, make sure your Docker installation is updated to support Composer V2.\", \" Upgrading From Older Versions If you are migrating from an older version of Appwrite, you need to follow the migration instructions.\"]}, {\"level\": 2, \"title\": \"Install with Docker\", \"body\": [\"The easiest way to start running your Appwrite server is by running our Docker installer tool from your terminal. Before running the installation command, make sure you have Docker CLI installed on your host machine.\", \"You will be prompted to configure the following during the setup command:\", \" Your Appwrite instance's HTTP and HTTPS ports. Your Appwrite instance's secret key which used to encrypt sensitive data. Your Appwrite instance's main hostname. Appwrite will generate a certificate using this hostname. Your Appwrite instance's DNS A record hostname. Typically set to the same value as your Appwrite instance's hostname.\"]}, {\"level\": 3, \"title\": \"Unix\", \"body\": [\" docker run -it --rm \\\\\\n --volume /var/run/docker.sock:/var/run/docker.sock \\\\\\n --volume \\\"$(pwd)\\\"/appwrite:/usr/src/code/appwrite:rw \\\\\\n --entrypoint=\\\"install\\\" \\\\\\n appwrite/appwrite:1.4.0\"]}, {\"level\": 3, \"title\": \"Windows\", \"body\": [\"Hyper-V and Containers Windows features must be enabled to run Appwrite on Windows with Docker. If you don't have these features available, you can install Docker Desktop which uses Virtualbox to run Appwrite on a Virtual Machine.\", \" CMD docker run -it --rm ^\\n --volume //var/run/docker.sock:/var/run/docker.sock ^\\n --volume \\\"%cd%\\\"/appwrite:/usr/src/code/appwrite:rw ^\\n --entrypoint=\\\"install\\\" ^\\n appwrite/appwrite:1.4.0 PowerShell docker run -it --rm `\\n --volume /var/run/docker.sock:/var/run/docker.sock `\\n --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `\\n --entrypoint=\\\"install\\\" `\\n appwrite/appwrite:1.4.0 \"]}, {\"level\": 2, \"title\": \"One-Click Setups\", \"body\": [\" In addition to running Appwrite locally, you can also launch Appwrite using a pre-configured setup. This allows you to get up and running with Appwrite quickly without installing Docker on your local machine.\", \"Choose from one of the providers below:\", \" Provider DigitalOcean Click to Install Gitpod Click to Install Akamai Compute Click to Install \"]}, {\"level\": 2, \"title\": \"Next Steps\", \"body\": [\"Self-hosting Appwrite gives you more configurable options. You can customize Appwrite with your choice of S3 compatible storage adaptors, email and SMS providers, functions runtimes, and more.\", \" Learn about configuring Appwrite\", \"Self-hosted Appwrite instances can be made production ready. To run Appwrite successfully in a production environment, you should follow a few basic concepts and best practices.\", \" Learn about Appwrite in production\"]}, {\"level\": 2, \"title\": \"Manual (using docker-compose.yml)\", \"body\": [\"For advanced Docker users, the manual installation might seem more familiar. To set up Appwrite manually, download the Appwrite base docker-compose.yml and .env files, then move them inside a directory named appwrite. After the download completes, update the different environment variables as you wish in the .env file and start the Appwrite stack using the following Docker command:\", \" docker compose up -d --remove-orphans\", \"Once the Docker installation completes, go to your machine's hostname or IP address on your browser to access the Appwrite Console. Please note that on hosts that are not Linux-native, the server might take a few minutes to start after installation completes.\"]}, {\"level\": 2, \"title\": \"Stop\", \"body\": [\"You can stop your Appwrite containers by using the following command executed from the same directory as your docker-compose.yml file.\", \" docker compose stop\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/self-hosting"}} \ No newline at end of file diff --git a/docs/ee43f170-1f0c-11ee-98fa-00155da08df7.json b/docs/4eeda506-4583-11ee-9922-f2ea36f81204.json similarity index 73% rename from docs/ee43f170-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eeda506-4583-11ee-9922-f2ea36f81204.json index e31bf89..0ceee88 100644 --- a/docs/ee43f170-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eeda506-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Configuration \", \"body\": [\" Self-hosting allows you to customize Appwrite to meet your needs and preferences. Here's a list of things you will need to set up before developing with Appwrite. Before you start, back up your .env and docker-compose.yml files.\"]}, {\"level\": 2, \"title\": \"Local Development\", \"body\": [\"Self-hosting Appwrite for development lets you quickly prototype on your local machine. Since localhost is only a loopback address that points back at your development machine, there are some caveats you should be aware of when working with localhost.\", \"Appwrite generates a self-signed certificate for development on localhost, as connecting to unsecured HTTP is not allowed by default. If you're developing client apps on localhost, set setSelfSigned(true) while initializing your Appwrite client.\", \"If you're using an Android emulator to test your Flutter or Android apps, you can access localhost of your machine using the special alias IP 10.0.2.2.\", \"If you're testing your Flutter, Android, or iOS app on a mobile device, you will not be able to access the localhost of your PC or Mac. When testing with a physical device, you may use a service like ngrok to proxy the Appwrite instance.\"]}, {\"level\": 2, \"title\": \"Setup Email and SMS Delivery\", \"body\": [\" Appwrite requires an SMTP service to deliver emails. Email delivery is required for features like password recovery, account verification, MagicURL authentication, and team invites. You can use a third-party SMTP service or host your own SMTP server.\", \" Set up email delivery\", \" Appwrite supports multiple third-party SMS delivery providers. SMS delivery is required for phone authentication.\", \" Set up SMS delivery\"]}, {\"level\": 2, \"title\": \"Configure Function Runtimes\", \"body\": [\" Not all function runtimes are enabled by default. Enable the runtimes that you need and disable unused runtimes to save disk space on your server. To enable a runtime, add it to the _APP_FUNCTIONS_RUNTIMES environment variable as a comma separated list. \", \" The example below would enable Dart 2.15, .NET 6.0, and Java 18 runtimes.\", \" _APP_FUNCTIONS_RUNTIMES=dart-2.15, dotnet-6.0, java-18.0\", \"You can find a full list of supported runtimes on the environment variables page.\", \"You can also configure the maximum timeout that can be set on individual Appwrite functions. The maximum configurable timeout can be increased by changing the _APP_FUNCTIONS_TIMEOUT environment variable. This environment variable changes the configurable maximum but does not alter existing individual configurations.\"]}, {\"level\": 2, \"title\": \"Storage Adaptors\", \"body\": [\"Appwrite's Storage Service can be configured to store files locally, or with self-hosted and cloud storage services. By default, Appwrite's Storage Service stores files on your server's local storage. If you expect large volumes of data or the need to have scalable data storage, you may choose to use a separate storage service.\", \"Appwrite supports AWS S3, Digital Ocean Spaces, Backblaze, Linode, and Wasabi as storage adaptors. Some of these services can be self-hosted, just like Appwrite.\", \"You can select which storage adaptor to use by setting the _APP_STORAGE_DEVICE environment variable. Valid values are local, s3, dospaces, backblaze, linode and wasabi. Each storage adaptor requires its own set of additional environment variables to configure.\", \"The maximum size for individual file uploads is controlled by the _APP_STORAGE_LIMIT environment variable, which defaults to 30 MB. See Environment Variables for more information.\", \" Configure storage adaptors\"]}, {\"level\": 2, \"title\": \"Applying Changes\", \"body\": [\"After editing your docker-compose.yml or .env files, you will need to recreate your Appwrite stack by running the following compose command in your terminal.\", \" docker compose up -d\", \"You can verify if the changes have been successfully applied by running this command:\", \" docker compose exec appwrite vars\"]}]", "metadata": {"source": "https://appwrite.io/docs/configuration"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Configuration \", \"body\": [\" Self-hosting allows you to customize Appwrite to meet your needs and preferences. Here's a list of things you will need to set up before developing with Appwrite. Before you start, back up your .env and docker-compose.yml files.\"]}, {\"level\": 2, \"title\": \"Local Development\", \"body\": [\"Self-hosting Appwrite for development lets you quickly prototype on your local machine. Since localhost is only a loopback address that points back at your development machine, there are some caveats you should be aware of when working with localhost.\", \"Appwrite generates a self-signed certificate for development on localhost, as connecting to unsecured HTTP is not allowed by default. If you're developing client apps on localhost, set setSelfSigned(true) while initializing your Appwrite client.\", \"If you're using an Android emulator to test your Flutter or Android apps, you can access localhost of your machine using the special alias IP 10.0.2.2.\", \"If you're testing your Flutter, Android, or iOS app on a mobile device, you will not be able to access the localhost of your PC or Mac. When testing with a physical device, you may use a service like ngrok to proxy the Appwrite instance.\"]}, {\"level\": 2, \"title\": \"Setup Email and SMS Delivery\", \"body\": [\" Appwrite requires an SMTP service to deliver emails. Email delivery is required for features like password recovery, account verification, MagicURL authentication, and team invites. You can use a third-party SMTP service or host your own SMTP server.\", \" Set up email delivery\", \" Appwrite supports multiple third-party SMS delivery providers. SMS delivery is required for phone authentication.\", \" Set up SMS delivery\"]}, {\"level\": 2, \"title\": \"Configure Function Runtimes\", \"body\": [\" Not all function runtimes are enabled by default. Enable the runtimes that you need and disable unused runtimes to save disk space on your server. To enable a runtime, add it to the _APP_FUNCTIONS_RUNTIMES environment variable as a comma separated list. \", \" The example below would enable Dart 2.15, .NET 6.0, and Java 18 runtimes.\", \" _APP_FUNCTIONS_RUNTIMES=dart-2.15, dotnet-6.0, java-18.0\", \"You can find a full list of supported runtimes on the environment variables page.\", \"You can also configure the maximum timeout that can be set on individual Appwrite functions. The maximum configurable timeout can be increased by changing the _APP_FUNCTIONS_TIMEOUT environment variable. This environment variable changes the configurable maximum but does not alter existing individual configurations.\"]}, {\"level\": 2, \"title\": \"Storage Adaptors\", \"body\": [\"Appwrite's Storage Service can be configured to store files locally, or with self-hosted and cloud storage services. By default, Appwrite's Storage Service stores files on your server's local storage. If you expect large volumes of data or the need to have scalable data storage, you may choose to use a separate storage service.\", \"Appwrite supports AWS S3, Digital Ocean Spaces, Backblaze, Akamai Object Storage, and Wasabi as storage adaptors. Some of these services can be self-hosted, just like Appwrite.\", \"You can select which storage adaptor to use by setting the _APP_STORAGE_DEVICE environment variable. Valid values are local, s3, dospaces, backblaze, linode and wasabi. Each storage adaptor requires its own set of additional environment variables to configure.\", \"The maximum size for individual file uploads is controlled by the _APP_STORAGE_LIMIT environment variable, which defaults to 30 MB. See Environment Variables for more information.\", \" Configure storage adaptors\"]}, {\"level\": 2, \"title\": \"Applying Changes\", \"body\": [\"After editing your docker-compose.yml or .env files, you will need to recreate your Appwrite stack by running the following compose command in your terminal.\", \" docker compose up -d\", \"You can verify if the changes have been successfully applied by running this command:\", \" docker compose exec appwrite vars\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/configuration"}} \ No newline at end of file diff --git a/docs/4eedaf92-4583-11ee-9922-f2ea36f81204.json b/docs/4eedaf92-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..01e64dc --- /dev/null +++ b/docs/4eedaf92-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Environment Variables \", \"body\": [\"Appwrite environment variables allow you to edit your server setup configuration and customize it. You can easily change the environment variables by changing them when running Appwrite using Docker CLI or Docker Compose.\", \"Updating your Appwrite environment variables requires you to edit your Appwrite .env file. Your Docker files should be located inside the \\\"appwrite\\\" folder at the location where you first run the Appwrite installation script. It's recommended to use the .env file as a central point for updating your Appwrite configuration rather than changing them directly in your docker-compose.yml file.\", \"After editing your docker-compose.yml or .env files, you will need to recreate your Appwrite stack by running the following compose command in your terminal:\", \" docker compose up -d\", \"You can verify if the changes have been successfully applied by running this command:\", \" docker compose exec appwrite vars\", \"All Options:\", \" General Redis MariaDB InfluxDB StatsD SMTP Phone Storage Functions VCS (Version Control System) Maintenance GraphQL Migrations Assistant \"]}, {\"level\": 2, \"title\": \"General\", \"body\": [\" Name Description _APP_ENV Set your server running environment. By default, the var is set to 'development'. When deploying to production, change it to: 'production'. _APP_LOCALE Set your Appwrite's locale. By default, the locale is set to 'en'. _APP_OPTIONS_ABUSE Allows you to disable abuse checks and API rate limiting. By default, set to 'enabled'. To cancel the abuse checking, set to 'disabled'. It is not recommended to disable this check-in a production environment. _APP_OPTIONS_FORCE_HTTPS Allows you to force HTTPS connection to your API. This feature redirects any HTTP call to HTTPS and adds the 'Strict-Transport-Security' header to all HTTP responses. By default, set to 'enabled'. To disable, set to 'disabled'. This feature will work only when your ports are set to default 80 and 443. _APP_OPENSSL_KEY_V1 This is your server private secret key that is used to encrypt all sensitive data on your server. Appwrite server encrypts all secret data on your server like webhooks, HTTP passwords, user sessions, and storage files. The var is not set by default, if you wish to take advantage of Appwrite encryption capabilities you should change it and make sure to keep it a secret and have a backup for it. _APP_DOMAIN Your Appwrite domain address. When setting a public suffix domain, Appwrite will attempt to issue a valid SSL certificate automatically. When used with a dev domain, Appwrite will assign a self-signed SSL certificate. The default value is 'localhost'. _APP_DOMAIN_FUNCTIONS A domain to use for function preview URLs. Setting to empty turns off function preview URLs. _APP_DOMAIN_TARGET A DNS A record hostname to serve as a CNAME target for your Appwrite custom domains. You can use the same value as used for the Appwrite '_APP_DOMAIN' variable. The default value is 'localhost'. _APP_CONSOLE_WHITELIST_ROOT version >= 0.8.0 This option allows you to disable the creation of new users on the Appwrite console. When enabled only 1 user will be able to use the registration form. New users can be added by inviting them to your project. By default this option is enabled. _APP_CONSOLE_WHITELIST_EMAILS This option allows you to limit creation of new users on the Appwrite console. This option is very useful for small teams or sole developers. To enable it, pass a list of allowed email addresses separated by a comma. _APP_CONSOLE_WHITELIST_IPS This last option allows you to limit creation of users in Appwrite console for users sharing the same set of IP addresses. This option is very useful for team working with a VPN service or a company IP.To enable/activate this option, pass a list of allowed IP addresses separated by a comma. _APP_SYSTEM_EMAIL_NAME version >= 0.7.0 This is the sender name value that will appear on email messages sent to developers from the Appwrite console. The default value is: 'Appwrite'. You can use url encoded strings for spaces and special chars. _APP_SYSTEM_EMAIL_ADDRESS version >= 0.7.0 This is the sender email address that will appear on email messages sent to developers from the Appwrite console. The default value is 'team@appwrite.io'. You should choose an email address that is allowed to be used from your SMTP server to avoid the server email ending in the users' SPAM folders. _APP_SYSTEM_RESPONSE_FORMAT version >= 0.7.0 Use this environment variable to set the default Appwrite HTTP response format to support an older version of Appwrite. This option is useful to overcome breaking changes between versions. You can also use the X-Appwrite-Response-Format HTTP request header to overwrite the response for a specific request. This variable accepts any valid Appwrite version. To use the current version format, leave the value of the variable empty. _APP_SYSTEM_SECURITY_EMAIL_ADDRESS version >= 0.7.0 This is the email address used to issue SSL certificates for custom domains or the user agent in your webhooks payload. _APP_USAGE_STATS version >= 0.7.0 This variable allows you to disable the collection and displaying of usage stats. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'. When disabled, it's recommended to turn off the Worker Usage container to reduce resource usage. _APP_LOGGING_PROVIDER version >= 0.12.0 This variable allows you to enable logging errors to 3rd party providers. This value is empty by default, set the value to one of 'sentry', 'raygun', 'appSignal', 'logOwl' to enable the logger. _APP_LOGGING_CONFIG version >= 0.12.0 This variable configures authentication to 3rd party error logging providers. If using Sentry, this should be 'SENTRY_API_KEY;SENTRY_APP_ID'. If using Raygun, this should be Raygun API key. If using AppSignal, this should be AppSignal API key. If using LogOwl, this should be LogOwl Service Ticket. _APP_USAGE_AGGREGATION_INTERVAL version >= 1.1.0 Interval value containing the number of seconds that the Appwrite usage process should wait before aggregating stats and syncing it to Database from TimeSeries data. The default value is 30 seconds. Reintroduced in 1.1.0. _APP_USAGE_TIMESERIES_INTERVAL version >= 1.0.0 Deprecated since 1.1.0 use _APP_USAGE_AGGREGATION_INTERVAL instead. _APP_USAGE_DATABASE_INTERVAL version >= 1.0.0 Deprecated since 1.1.0 use _APP_USAGE_AGGREGATION_INTERVAL instead. _APP_WORKER_PER_CORE version >= 0.13.0 Internal Worker per core for the API, Realtime and Executor containers. Can be configured to optimize performance. \"]}, {\"level\": 2, \"title\": \"Redis\", \"body\": [\"Appwrite uses a Redis server for managing cache, queues and scheduled tasks. The Redis env vars are used to allow Appwrite server to connect to the Redis container.\", \" Name Description _APP_REDIS_HOST Redis server hostname address. Default value is: 'redis'. _APP_REDIS_PORT Redis server TCP port. Default value is: '6379'. _APP_REDIS_USER version >= 0.7 Redis server user. This is an optional variable. Default value is an empty string. _APP_REDIS_PASS version >= 0.7 Redis server password. This is an optional variable. Default value is an empty string. \"]}, {\"level\": 2, \"title\": \"MariaDB\", \"body\": [\"Appwrite is using a MariaDB server for managing persistent database data. The MariaDB env vars are used to allow Appwrite server to connect to the MariaDB container.\", \" Name Description _APP_DB_HOST MariaDB server host name address. Default value is: 'mariadb'. _APP_DB_PORT MariaDB server TCP port. Default value is: '3306'. _APP_DB_SCHEMA MariaDB server database schema. Default value is: 'appwrite'. _APP_DB_USER MariaDB server user name. Default value is: 'user'. _APP_DB_PASS MariaDB server user password. Default value is: 'password'. _APP_DB_ROOT_PASS MariaDB server root password. Default value is: 'rootsecretpassword'. \"]}, {\"level\": 2, \"title\": \"InfluxDB\", \"body\": [\"Appwrite uses an InfluxDB server for managing time-series data and server stats. The InfluxDB env vars are used to allow Appwrite server to connect to the InfluxDB container.\", \" Name Description _APP_INFLUXDB_HOST InfluxDB server host name address. Default value is: 'influxdb'. _APP_INFLUXDB_PORT InfluxDB server TCP port. Default value is: '8086'. \"]}, {\"level\": 2, \"title\": \"StatsD\", \"body\": [\"Appwrite uses a StatsD server for aggregating and sending stats data over a fast UDP connection. The StatsD env vars are used to allow Appwrite server to connect to the StatsD container.\", \" Name Description _APP_STATSD_HOST StatsD server host name address. Default value is: 'telegraf'. _APP_STATSD_PORT StatsD server TCP port. Default value is: '8125'. \"]}, {\"level\": 2, \"title\": \"SMTP\", \"body\": [\"Appwrite is using an SMTP server for emailing your projects users and server admins. The SMTP env vars are used to allow Appwrite server to connect to the SMTP container.If running in production, it might be easier to use a 3rd party SMTP server as it might be a little more difficult to set up a production SMTP server that will not send all your emails into your user\\\\'s SPAM folder.\", \" Name Description _APP_SMTP_HOST SMTP server host name address. Use an empty string to disable all mail sending from the server. The default value for this variable is an empty string _APP_SMTP_PORT SMTP server TCP port. Empty by default. _APP_SMTP_SECURE SMTP secure connection protocol. Empty by default, change to 'tls' if running on a secure connection. _APP_SMTP_USERNAME SMTP server user name. Empty by default. _APP_SMTP_PASSWORD SMTP server user password. Empty by default. \"]}, {\"level\": 2, \"title\": \"Phone\", \"body\": [\" Name Description _APP_SMS_PROVIDER version >= 0.15.0 Provider used for delivering SMS for Phone authentication. Use the following format: 'sms://[USER]:[SECRET]@[PROVIDER]'.Ensure [USER] and [SECRET] are URL encoded if they contain any non-alphanumeric characters.Available providers are twilio, text-magic, telesign, msg91, and vonage. _APP_SMS_FROM version >= 0.15.0 Phone number used for sending out messages. Must start with a leading '+' and maximum of 15 digits without spaces (+123456789). \"]}, {\"level\": 2, \"title\": \"Storage\", \"body\": [\" Name Description _APP_STORAGE_LIMIT version >= 0.7.0 Maximum file size allowed for file upload. The default value is 30MB. You should pass your size limit value in bytes. _APP_STORAGE_PREVIEW_LIMIT version >= 0.13.4 Maximum file size allowed for file image preview. The default value is 20MB. You should pass your size limit value in bytes. _APP_STORAGE_ANTIVIRUS This variable allows you to disable the internal anti-virus scans. This value is set to 'disabled' by default, to enable the scans set the value to 'enabled'. Before enabling, you must add the ClamAV service and depend on it on main Appwrite service. _APP_STORAGE_ANTIVIRUS_HOST version >= 0.7.0 ClamAV server host name address. Default value is: 'clamav'. _APP_STORAGE_ANTIVIRUS_PORT version >= 0.7.0 ClamAV server TCP port. Default value is: '3310'. _APP_STORAGE_DEVICE version >= 0.13.0 Select default storage device. The default value is 'local'. List of supported adapters are 'local', 's3', 'dospaces', 'backblaze', 'linode' and 'wasabi'. _APP_STORAGE_S3_ACCESS_KEY version >= 0.13.0 AWS S3 storage access key. Required when the storage adapter is set to S3. You can get your access key from your AWS console _APP_STORAGE_S3_SECRET version >= 0.13.0 AWS S3 storage secret key. Required when the storage adapter is set to S3. You can get your secret key from your AWS console. _APP_STORAGE_S3_REGION version >= 0.13.0 AWS S3 storage region. Required when storage adapter is set to S3. You can find your region info for your bucket from AWS console. _APP_STORAGE_S3_BUCKET version >= 0.13.0 AWS S3 storage bucket. Required when storage adapter is set to S3. You can create buckets in your AWS console. _APP_STORAGE_DO_SPACES_ACCESS_KEY version >= 0.13.0 DigitalOcean spaces access key. Required when the storage adapter is set to DOSpaces. You can get your access key from your DigitalOcean console. _APP_STORAGE_DO_SPACES_SECRET version >= 0.13.0 DigitalOcean spaces secret key. Required when the storage adapter is set to DOSpaces. You can get your secret key from your DigitalOcean console. _APP_STORAGE_DO_SPACES_REGION version >= 0.13.0 DigitalOcean spaces region. Required when storage adapter is set to DOSpaces. You can find your region info for your space from DigitalOcean console. _APP_STORAGE_DO_SPACES_BUCKET version >= 0.13.0 DigitalOcean spaces bucket. Required when storage adapter is set to DOSpaces. You can create spaces in your DigitalOcean console. _APP_STORAGE_BACKBLAZE_ACCESS_KEY version >= 0.14.2 Backblaze access key. Required when the storage adapter is set to Backblaze. Your Backblaze keyID will be your access key. You can get your keyID from your Backblaze console. _APP_STORAGE_BACKBLAZE_SECRET version >= 0.14.2 Backblaze secret key. Required when the storage adapter is set to Backblaze. Your Backblaze applicationKey will be your secret key. You can get your applicationKey from your Backblaze console. _APP_STORAGE_BACKBLAZE_REGION version >= 0.14.2 Backblaze region. Required when storage adapter is set to Backblaze. You can find your region info from your Backblaze console. _APP_STORAGE_BACKBLAZE_BUCKET version >= 0.14.2 Backblaze bucket. Required when storage adapter is set to Backblaze. You can create your bucket from your Backblaze console. _APP_STORAGE_LINODE_ACCESS_KEY version >= 0.14.2 Linode object storage access key. Required when the storage adapter is set to Linode. You can get your access key from your Linode console. _APP_STORAGE_LINODE_SECRET version >= 0.14.2 Linode object storage secret key. Required when the storage adapter is set to Linode. You can get your secret key from your Linode console. _APP_STORAGE_LINODE_REGION version >= 0.14.2 Linode object storage region. Required when storage adapter is set to Linode. You can find your region info from your Linode console. _APP_STORAGE_LINODE_BUCKET version >= 0.14.2 Linode object storage bucket. Required when storage adapter is set to Linode. You can create buckets in your Linode console. _APP_STORAGE_WASABI_ACCESS_KEY version >= 0.14.2 Wasabi access key. Required when the storage adapter is set to Wasabi. You can get your access key from your Wasabi console. _APP_STORAGE_WASABI_SECRET version >= 0.14.2 Wasabi secret key. Required when the storage adapter is set to Wasabi. You can get your secret key from your Wasabi console. _APP_STORAGE_WASABI_REGION version >= 0.14.2 Wasabi region. Required when storage adapter is set to Wasabi. You can find your region info from your Wasabi console. _APP_STORAGE_WASABI_BUCKET version >= 0.14.2 Wasabi bucket. Required when storage adapter is set to Wasabi. You can create buckets in your Wasabi console. \"]}, {\"level\": 2, \"title\": \"Functions\", \"body\": [\" Name Description _APP_FUNCTIONS_SIZE_LIMIT version >= 0.13.0 The maximum size deployment in bytes. The default value is 30MB. _APP_FUNCTIONS_TIMEOUT version >= 0.7.0 The maximum number of seconds allowed as a timeout value when creating a new function. The default value is 900 seconds. This is the global limit, timeout for individual functions are configured in the function's settings or in appwrite.json. _APP_FUNCTIONS_BUILD_TIMEOUT version >= 0.13.0 The maximum number of seconds allowed as a timeout value when building a new function. The default value is 900 seconds. _APP_FUNCTIONS_CONTAINERS version >= 0.7.0 Deprecated since 1.2.0. Runtimes now timeout by inactivity using '_APP_FUNCTIONS_INACTIVE_THRESHOLD'. _APP_FUNCTIONS_CPUS version >= 0.7.0 The maximum number of CPU core a single cloud function is allowed to use. Please note that setting a value higher than available cores will result in a function error, which might result in an error. The default value is empty. When it's empty, CPU limit will be disabled. _APP_FUNCTIONS_MEMORY version >= 0.7.0 The maximum amount of memory a single cloud function is allowed to use in megabytes. The default value is empty. When it's empty, memory limit will be disabled. _APP_FUNCTIONS_MEMORY_SWAP version >= 0.7.0 Deprecated since 1.2.0. High use of swap memory is not recommended to preserve harddrive health. _APP_FUNCTIONS_RUNTIMES version >= 0.8.0 This option allows you to enable or disable runtime environments for cloud functions. Disable unused runtimes to save disk space.To enable cloud function runtimes, pass a list of enabled environments separated by a comma.Currently, supported environments are: node-14.5, node-16.0, node-18.0, node-19.0, node-20.0, php-8.0, php-8.1, php-8.2, ruby-3.0, ruby-3.1, ruby-3.2, python-3.8, python-3.9, python-3.10, python-3.11, deno-1.21, deno-1.24, deno-1.35, dart-2.15, dart-2.16, dart-2.17, dart-2.18, dart-3.0, dotnet-3.1, dotnet-6.0, dotnet-7.0, java-8.0, java-11.0, java-17.0, java-18.0, swift-5.5, swift-5.8, kotlin-1.6, kotlin-1.8, cpp-17, cpp-20 _APP_EXECUTOR_SECRET version >= 0.13.0 The secret key used by Appwrite to communicate with the function executor. Make sure to change this! _APP_EXECUTOR_HOST version >= 0.13.0 The host used by Appwrite to communicate with the function executor! _APP_EXECUTOR_RUNTIME_NETWORK version >= 0.13.0 Deprecated with 0.14.0, use 'OPEN_RUNTIMES_NETWORK' instead! _APP_FUNCTIONS_ENVS version >= 0.7.0 Deprecated with 0.8.0, use '_APP_FUNCTIONS_RUNTIMES' instead! _APP_FUNCTIONS_INACTIVE_THRESHOLD version >= 0.13.0 The minimum time a function must be inactive before it can be shut down and cleaned up. This feature is intended to clean up unused containers. Containers may remain active for longer than the interval before being shut down, as Appwrite only cleans up unused containers every hour. If no value is provided, the default is 60 seconds. DOCKERHUB_PULL_USERNAME version >= 0.10.0 Deprecated with 1.2.0, use '_APP_DOCKER_HUB_USERNAME' instead! DOCKERHUB_PULL_PASSWORD version >= 0.10.0 Deprecated with 1.2.0, use '_APP_DOCKER_HUB_PASSWORD' instead! DOCKERHUB_PULL_EMAIL version >= 0.10.0 Deprecated since 1.2.0. Email is no longer needed. OPEN_RUNTIMES_NETWORK version >= 0.13.0 Deprecated with 1.2.0, use '_APP_FUNCTIONS_RUNTIMES_NETWORK' instead! _APP_FUNCTIONS_RUNTIMES_NETWORK version >= 1.2.0 The docker network used for communication between the executor and runtimes. _APP_DOCKER_HUB_USERNAME version >= 1.2.0 The username for hub.docker.com. This variable is used to pull images from hub.docker.com. _APP_DOCKER_HUB_PASSWORD version >= 1.2.0 The password for hub.docker.com. This variable is used to pull images from hub.docker.com. _APP_FUNCTIONS_MAINTENANCE_INTERVAL version >= 1.2.0 Interval how often executor checks for inactive runimes. The default value is 60 seconds. \"]}, {\"level\": 2, \"title\": \"VCS (Version Control System)\", \"body\": [\" Name Description _APP_VCS_GITHUB_APP_NAME version >= 1.4.0 Name of your GitHub app. This value should be set to your GitHub application's URL. _APP_VCS_GITHUB_PRIVATE_KEY version >= 1.4.0 GitHub app RSA private key. You can generate private keys from GitHub application settings. _APP_VCS_GITHUB_APP_ID version >= 1.4.0 GitHub application ID. You can find it in your GitHub application details. _APP_VCS_GITHUB_CLIENT_ID version >= 1.4.0 GitHub client ID. You can find it in your GitHub application details. _APP_VCS_GITHUB_CLIENT_SECRET version >= 1.4.0 GitHub client secret. You can generate secrets in your GitHub application settings. _APP_VCS_GITHUB_WEBHOOK_SECRET version >= 1.4.0 GitHub webhook secret. You can configure it in your GitHub application settings under webhook section. \"]}, {\"level\": 2, \"title\": \"Maintenance\", \"body\": [\" Name Description _APP_MAINTENANCE_INTERVAL version >= 0.7.0 Interval value containing the number of seconds that the Appwrite maintenance process should wait before executing system cleanups and optimizations. The default value is 86400 seconds (1 day). _APP_MAINTENANCE_RETENTION_CACHE version >= 1.0.0 The maximum duration (in seconds) upto which to retain cached files. The default value is 2592000 seconds (30 days). _APP_MAINTENANCE_RETENTION_EXECUTION version >= 0.7.0 The maximum duration (in seconds) upto which to retain execution logs. The default value is 1209600 seconds (14 days). _APP_MAINTENANCE_RETENTION_AUDIT version >= 0.7.0 IThe maximum duration (in seconds) upto which to retain audit logs. The default value is 1209600 seconds (14 days). _APP_MAINTENANCE_RETENTION_ABUSE version >= 0.7.0 The maximum duration (in seconds) upto which to retain abuse logs. The default value is 86400 seconds (1 day). _APP_MAINTENANCE_RETENTION_USAGE_HOURLY The maximum duration (in seconds) upto which to retain hourly usage metrics. The default value is 8640000 seconds (100 days). _APP_MAINTENANCE_RETENTION_SCHEDULES version >= TBD Schedules deletion interval ( in seconds ) \"]}, {\"level\": 2, \"title\": \"GraphQL\", \"body\": [\" Name Description _APP_GRAPHQL_MAX_BATCH_SIZE version >= 1.2.0 Maximum number of batched queries per request. The default value is 10. _APP_GRAPHQL_MAX_COMPLEXITY version >= 1.2.0 Maximum complexity of a GraphQL query. One field adds one to query complexity. Lists multiply the complexity by the number of items requested. The default value is 250. _APP_GRAPHQL_MAX_DEPTH version >= 1.2.0 Maximum depth of a GraphQL query. One nested field level adds one to query depth. The default value is 3. \"]}, {\"level\": 2, \"title\": \"Migrations\", \"body\": [\" Name Description _APP_MIGRATIONS_FIREBASE_CLIENT_ID version >= 1.4.0 Google OAuth client ID. You can find it in your GCP application settings. _APP_MIGRATIONS_FIREBASE_CLIENT_SECRET version >= 1.4.0 Google OAuth client secret. You can generate secrets in your GCP application settings. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/environment-variables"}} \ No newline at end of file diff --git a/docs/ee43f6a2-1f0c-11ee-98fa-00155da08df7.json b/docs/4eedc306-4583-11ee-9922-f2ea36f81204.json similarity index 96% rename from docs/ee43f6a2-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eedc306-4583-11ee-9922-f2ea36f81204.json index 26e890f..56a2522 100644 --- a/docs/ee43f6a2-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eedc306-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Email Delivery \", \"body\": [\"Appwrite v0.7 and above come with support for easy integrations with 3rd party SMTP providers. In order for emails to work, you will need to setup proper SMTP configuration as described below.\", \"Because email deliverability can be both tricky and hard, it is often easier to delegate this responsibility to a 3rd-party SMTP provider. These providers help you abstract the complexity of passing SPAM filters by doing a lot of the advanced configuration and validation for you.\", \"In this document, you will learn how to connect a 3rd party SMTP provider like MailGun or SendGrid with Appwrite to help you get better email deliverability.\"]}, {\"level\": 2, \"title\": \"Update Your .env File\", \"body\": [\"At this stage, we assume that you have already installed Appwrite. Else, you can follow our Self Hosting Guide for the installation. Appwrite offers multiple environment variables to customize your server setup to your needs. To configure Appwrite to use your own SMTP server, you need to set the following environment variables in the hidden .env file that comes with your Appwrite installation.\", \"_APP_SMTP_HOST - SMTP server host name address. Use an empty string to disable all mail sending from the server. The default value for this variable is an empty string\", \"_APP_SMTP_PORT - SMTP server TCP port. Empty by default.\", \"_APP_SMTP_SECURE - SMTP secure connection protocol. Empty by default, change to 'tls' if running on a secure connection. Valid values are empty, 'tls', and 'ssl'.\", \"_APP_SMTP_USERNAME - SMTP server user name. Empty by default.\", \"_APP_SMTP_PASSWORD - SMTP server user password. Empty by default.\", \"_APP_SYSTEM_EMAIL_ADDRESS - Configured sender email address, \\\"team@appwrite.io\\\" by default. This is the email address seen by recipients.\", \"Here's a sample configuration if you're using SendGrid as your SMTP provider. \", \" _APP_SMTP_HOST=smtp.sendgrid.net\\n_APP_SMTP_PORT=587\\n_APP_SMTP_SECURE=tls\\n_APP_SMTP_USERNAME=YOUR-SMTP-USERNAME\\n_APP_SMTP_PASSWORD=YOUR-SMTP-PASSWORD\\n_APP_SYSTEM_EMAIL_ADDRESS=YOUR-SENDER-EMAIL\"]}, {\"level\": 2, \"title\": \"Restart Your Appwrite Server\", \"body\": [\"Once you've updated your .env file, you need to restart your Appwrite instance. Navigate to the directory containing the docker-compose.yml file of your Appwrite instance and run the following command from your terminal:\", \" docker compose up -d\"]}]", "metadata": {"source": "https://appwrite.io/docs/email-delivery"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Email Delivery \", \"body\": [\"Appwrite v0.7 and above come with support for easy integrations with 3rd party SMTP providers. In order for emails to work, you will need to setup proper SMTP configuration as described below.\", \"Because email deliverability can be both tricky and hard, it is often easier to delegate this responsibility to a 3rd-party SMTP provider. These providers help you abstract the complexity of passing SPAM filters by doing a lot of the advanced configuration and validation for you.\", \"In this document, you will learn how to connect a 3rd party SMTP provider like MailGun or SendGrid with Appwrite to help you get better email deliverability.\"]}, {\"level\": 2, \"title\": \"Update Your .env File\", \"body\": [\"At this stage, we assume that you have already installed Appwrite. Else, you can follow our Self Hosting Guide for the installation. Appwrite offers multiple environment variables to customize your server setup to your needs. To configure Appwrite to use your own SMTP server, you need to set the following environment variables in the hidden .env file that comes with your Appwrite installation.\", \"_APP_SMTP_HOST - SMTP server host name address. Use an empty string to disable all mail sending from the server. The default value for this variable is an empty string\", \"_APP_SMTP_PORT - SMTP server TCP port. Empty by default.\", \"_APP_SMTP_SECURE - SMTP secure connection protocol. Empty by default, change to 'tls' if running on a secure connection. Valid values are empty, 'tls', and 'ssl'.\", \"_APP_SMTP_USERNAME - SMTP server user name. Empty by default.\", \"_APP_SMTP_PASSWORD - SMTP server user password. Empty by default.\", \"_APP_SYSTEM_EMAIL_ADDRESS - Configured sender email address, \\\"team@appwrite.io\\\" by default. This is the email address seen by recipients.\", \"Here's a sample configuration if you're using SendGrid as your SMTP provider. \", \" _APP_SMTP_HOST=smtp.sendgrid.net\\n_APP_SMTP_PORT=587\\n_APP_SMTP_SECURE=tls\\n_APP_SMTP_USERNAME=YOUR-SMTP-USERNAME\\n_APP_SMTP_PASSWORD=YOUR-SMTP-PASSWORD\\n_APP_SYSTEM_EMAIL_ADDRESS=YOUR-SENDER-EMAIL\"]}, {\"level\": 2, \"title\": \"Restart Your Appwrite Server\", \"body\": [\"Once you've updated your .env file, you need to restart your Appwrite instance. Navigate to the directory containing the docker-compose.yml file of your Appwrite instance and run the following command from your terminal:\", \" docker compose up -d\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/email-delivery"}} \ No newline at end of file diff --git a/docs/ee43f850-1f0c-11ee-98fa-00155da08df7.json b/docs/4eedca40-4583-11ee-9922-f2ea36f81204.json similarity index 57% rename from docs/ee43f850-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eedca40-4583-11ee-9922-f2ea36f81204.json index 11b9d72..0d35d5c 100644 --- a/docs/ee43f850-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eedca40-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" SMS Delivery \", \"body\": [\"Appwrite supports phone authentication, which allows users to create accounts and log in using SMS messages. Appwrite requires an SMS provider to be setup before using Phone authentication.\"]}, {\"level\": 2, \"title\": \"SMS Providers\", \"body\": [\"Appwrite supports a growing list of SMS providers that you can choose from. Choose one from the list below and set up an account.\", \" SMS Provider Create Account Get Credentials Twilio Website Documentation TextMagic Website Documentation Telesign Website Documentation MSG91 Website Documentation Vonage Website Documentation \"]}, {\"level\": 2, \"title\": \"Update Your .env File\", \"body\": [\"You will need to configure these environment variables and restart your Appwrite containers before you can use phone authentication.\", \" Provider _APP_SMS_PROVIDER _APP_SMS_FROM Twilio sms://[ACCOUNT SID]:[AUTH TOKEN]@twilio [TWILIO PHONE NUMBER] TextMagic sms://[USERNAME]:[API KEY]@text-magic [PHONE NUMBER OR SENDER ID] TeleSign sms://[CUSTOMER ID]:[API KEY]@telesign [TELESIGN PHONE NUMBER] MSG91 sms://[SENDER ID]:[AUTH KEY]@MSG91 [FLOW ID] Vonage sms://[API KEY]:[API SECRET]@vonage [PHONE NUMBER OR BRAND NAME] \"]}]", "metadata": {"source": "https://appwrite.io/docs/sms-delivery"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" SMS Delivery \", \"body\": [\"Appwrite supports phone authentication, which allows users to create accounts and log in using SMS messages. Appwrite requires an SMS provider to be setup before using Phone authentication.\"]}, {\"level\": 2, \"title\": \"SMS Providers\", \"body\": [\"Appwrite supports a growing list of SMS providers that you can choose from. Choose one from the list below and set up an account.\", \" SMS Provider Create Account Get Credentials Twilio Website Documentation TextMagic Website Documentation Telesign Website Documentation MSG91 Website Documentation Vonage Website Documentation \"]}, {\"level\": 2, \"title\": \"Update Your .env File\", \"body\": [\"You will need to configure these environment variables and restart your Appwrite containers before you can use phone authentication.\", \" Ensure the values you insert in the _APP_SMS_PROVIDER placeholders are URL encoded if they contain any non-alphanumeric characters.\", \" Provider _APP_SMS_PROVIDER _APP_SMS_FROM Twilio sms://[ACCOUNT SID]:[AUTH TOKEN]@twilio [TWILIO PHONE NUMBER] TextMagic sms://[USERNAME]:[API KEY]@text-magic [PHONE NUMBER OR SENDER ID] TeleSign sms://[CUSTOMER ID]:[API KEY]@telesign [TELESIGN PHONE NUMBER] MSG91 sms://[SENDER ID]:[AUTH KEY]@MSG91 [FLOW ID] Vonage sms://[API KEY]:[API SECRET]@vonage [PHONE NUMBER OR BRAND NAME] \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/sms-delivery"}} \ No newline at end of file diff --git a/docs/ee43f9d6-1f0c-11ee-98fa-00155da08df7.json b/docs/4eedd0bc-4583-11ee-9922-f2ea36f81204.json similarity index 98% rename from docs/ee43f9d6-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eedd0bc-4583-11ee-9922-f2ea36f81204.json index c9260d4..7350a15 100644 --- a/docs/ee43f9d6-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eedd0bc-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Certificates \", \"body\": [\"Appwrite uses Let's Encrypt to auto-generate TLS certificates for your Appwrite instance to ensure your API traffic is appropriately encrypted. For Appwrite to properly generate certificates, a few conditions need to be met.\", \"You need to use a public-facing domain with a known TLD pointing to your Appwrite instance.Your _APP_ENV environment variable should be set for production mode. The default Appwrite setup comes with this predefined setting, so you should be OK unless you change it.You need to ensure you have a valid email address set on _APP_SYSTEM_SECURITY_EMAIL_ADDRESS. The default setup comes with certs@appwrite.io as the default value. While this address will work, it's recommended to change it to your own email.Currently, Appwrite is using the ACME HTTP challenge to issue an TLS certificate. This forces us to generate certificates for port 443 when the challenge itself is performed on port 80. At this point, other ports will not work. To overcome this limit, you can set Appwrite on a separate sub-domain or use your own certificate or proxy server in front of Appwrite.\"]}, {\"level\": 2, \"title\": \"Debugging\", \"body\": [\"If you're still struggling with your certificates, check the Appwrite certificates worker log. You can do that with the following command:\", \" docker compose logs appwrite-worker-certificates\"]}, {\"level\": 2, \"title\": \"Generation Cycle\", \"body\": [\"Appwrite auto-generates a certificate for your main domain when you first visit it. If your browser shows an insecure connection warning, you must proceed to trigger certificate generation. The domain in environment variable _APP_DOMAIN is considered your main domain. If you didn't set this variable, the first domain you visit would be marked as the main domain for your Appwrite instance. Appwrite follows this concept of the main domain to prevent generating certificates for domains you don't own. Keep in mind that you can always add additional domains as Custom Domains in your project settings to enable certificate generation for any domain.\", \"Certificate renewal is done as a part of the Appwrite maintenance task. Unless modified with environment variable _APP_MAINTENANCE_INTERVAL, this task runs every 24 hours. During this task, Appwrite looks for certificates due for renewal and renews them. One maintenance cycle only attempts to renew up to 200 certificates to respect the Let's Encrypt API limit. Every Let's Encrypt certificate is valid for 90 days, but Appwrite starts to renew them 30 days before the expiration.\", \"There are many reasons why certificate generation could fail, such as incorrect DNS settings, hitting Let's Encrypt API limit, or a failed HTTP ACME challenge. Every certificate generation failure is attempted again in the next renewal cycle, but only up to 5 attempts. If you need to run certificate generation for a domain beyond the attempts limit, you can use the manual generation method. \"]}, {\"level\": 2, \"title\": \"Manual Generation\", \"body\": [\"Since Appwrite generates and renews certificates automatically, a manual generation is seldom required. A manual generation can be useful when you hit the API limit and don't want to wait for the next maintenance cycle to renew the certificate. Use the following command to generate a certificate for your main domain:\", \" docker compose exec appwrite ssl\", \"If you want to generate a certificate for a specific domain, pass it as a parameter into the command:\", \" docker compose exec appwrite ssl domain=\\\"api.myapp.com\\\"\"]}]", "metadata": {"source": "https://appwrite.io/docs/certificates"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Certificates \", \"body\": [\"Appwrite uses Let's Encrypt to auto-generate TLS certificates for your Appwrite instance to ensure your API traffic is appropriately encrypted. For Appwrite to properly generate certificates, a few conditions need to be met.\", \"You need to use a public-facing domain with a known TLD pointing to your Appwrite instance.Your _APP_ENV environment variable should be set for production mode. The default Appwrite setup comes with this predefined setting, so you should be OK unless you change it.You need to ensure you have a valid email address set on _APP_SYSTEM_SECURITY_EMAIL_ADDRESS. The default setup comes with certs@appwrite.io as the default value. While this address will work, it's recommended to change it to your own email.Currently, Appwrite is using the ACME HTTP challenge to issue an TLS certificate. This forces us to generate certificates for port 443 when the challenge itself is performed on port 80. At this point, other ports will not work. To overcome this limit, you can set Appwrite on a separate sub-domain or use your own certificate or proxy server in front of Appwrite.\"]}, {\"level\": 2, \"title\": \"Debugging\", \"body\": [\"If you're still struggling with your certificates, check the Appwrite certificates worker log. You can do that with the following command:\", \" docker compose logs appwrite-worker-certificates\"]}, {\"level\": 2, \"title\": \"Generation Cycle\", \"body\": [\"Appwrite auto-generates a certificate for your main domain when you first visit it. If your browser shows an insecure connection warning, you must proceed to trigger certificate generation. The domain in environment variable _APP_DOMAIN is considered your main domain. If you didn't set this variable, the first domain you visit would be marked as the main domain for your Appwrite instance. Appwrite follows this concept of the main domain to prevent generating certificates for domains you don't own. Keep in mind that you can always add additional domains as Custom Domains in your project settings to enable certificate generation for any domain.\", \"Certificate renewal is done as a part of the Appwrite maintenance task. Unless modified with environment variable _APP_MAINTENANCE_INTERVAL, this task runs every 24 hours. During this task, Appwrite looks for certificates due for renewal and renews them. One maintenance cycle only attempts to renew up to 200 certificates to respect the Let's Encrypt API limit. Every Let's Encrypt certificate is valid for 90 days, but Appwrite starts to renew them 30 days before the expiration.\", \"There are many reasons why certificate generation could fail, such as incorrect DNS settings, hitting Let's Encrypt API limit, or a failed HTTP ACME challenge. Every certificate generation failure is attempted again in the next renewal cycle, but only up to 5 attempts. If you need to run certificate generation for a domain beyond the attempts limit, you can use the manual generation method. \"]}, {\"level\": 2, \"title\": \"Manual Generation\", \"body\": [\"Since Appwrite generates and renews certificates automatically, a manual generation is seldom required. A manual generation can be useful when you hit the API limit and don't want to wait for the next maintenance cycle to renew the certificate. Use the following command to generate a certificate for your main domain:\", \" docker compose exec appwrite ssl\", \"If you want to generate a certificate for a specific domain, pass it as a parameter into the command:\", \" docker compose exec appwrite ssl domain=\\\"api.myapp.com\\\"\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/certificates"}} \ No newline at end of file diff --git a/docs/ee43fb84-1f0c-11ee-98fa-00155da08df7.json b/docs/4eedd6e8-4583-11ee-9922-f2ea36f81204.json similarity index 96% rename from docs/ee43fb84-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eedd6e8-4583-11ee-9922-f2ea36f81204.json index 481e304..ee28c60 100644 --- a/docs/ee43fb84-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eedd6e8-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Debugging \", \"body\": [\"Appwrite comes with a few built-in tools and methods that easily debug and investigate issues on your Appwrite stack environment.\"]}, {\"level\": 2, \"title\": \"Doctor CLI \\u00a0available from >= v0.7\", \"body\": [\"The doctor CLI helps you validate your server health and best practices. Using the Doctor CLI, you can verify your server configuration for best practices, validate your Appwrite stack connectivity and storage read and write access, and available storage space.\", \"To run the Doctor check, simply run the following command from your terminal. You might need to replace 'appwrite' with your Appwrite Docker container ID. To find out what's your container ID, you can run `docker ps` command (more on that, in the next section).\", \" docker exec appwrite doctor\"]}, {\"level\": 2, \"title\": \"Logs\", \"body\": [\"Checking your Appwrite containers can be a great way to pinpoint where and what exactly happens inside your Appwrite services. You can list your Appwrite containers using the following command in your terminal:\", \" docker ps\", \"The output of this command will show you a list of all your running Docker containers, their ID's, uptime, and open ports. You can use each container ID to get a list of all the container `stdout` and `stderr` logs by using the following command:\", \" docker logs [CONTAINER-ID]\"]}, {\"level\": 2, \"title\": \"Status Codes\", \"body\": [\"Appwrite uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, invalid input, etc.). Codes in the 5xx range indicate an error with the Appwrite server, but these are rare.\", \"Learn more about Appwrite status codes\"]}]", "metadata": {"source": "https://appwrite.io/docs/debugging"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Debugging \", \"body\": [\"Appwrite comes with a few built-in tools and methods that easily debug and investigate issues on your Appwrite stack environment.\"]}, {\"level\": 2, \"title\": \"Doctor CLI \\u00a0available from >= v0.7\", \"body\": [\"The doctor CLI helps you validate your server health and best practices. Using the Doctor CLI, you can verify your server configuration for best practices, validate your Appwrite stack connectivity and storage read and write access, and available storage space.\", \"To run the Doctor check, simply run the following command from your terminal. You might need to replace 'appwrite' with your Appwrite Docker container ID. To find out what's your container ID, you can run `docker ps` command (more on that, in the next section).\", \" docker exec appwrite doctor\"]}, {\"level\": 2, \"title\": \"Logs\", \"body\": [\"Checking your Appwrite containers can be a great way to pinpoint where and what exactly happens inside your Appwrite services. You can list your Appwrite containers using the following command in your terminal:\", \" docker ps\", \"The output of this command will show you a list of all your running Docker containers, their ID's, uptime, and open ports. You can use each container ID to get a list of all the container `stdout` and `stderr` logs by using the following command:\", \" docker logs [CONTAINER-ID]\"]}, {\"level\": 2, \"title\": \"Status Codes\", \"body\": [\"Appwrite uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, invalid input, etc.). Codes in the 5xx range indicate an error with the Appwrite server, but these are rare.\", \"Learn more about Appwrite status codes\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/debugging"}} \ No newline at end of file diff --git a/docs/ee43fdbe-1f0c-11ee-98fa-00155da08df7.json b/docs/4eeddc6a-4583-11ee-9922-f2ea36f81204.json similarity index 86% rename from docs/ee43fdbe-1f0c-11ee-98fa-00155da08df7.json rename to docs/4eeddc6a-4583-11ee-9922-f2ea36f81204.json index 84a0afb..37f68ae 100644 --- a/docs/ee43fdbe-1f0c-11ee-98fa-00155da08df7.json +++ b/docs/4eeddc6a-4583-11ee-9922-f2ea36f81204.json @@ -1 +1 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Upgrade \", \"body\": [\"To upgrade your Appwrite server from an older version, you should use the Appwrite migration tool after you have installed the new version. The migration tool will adjust your Appwrite data to the new version's structure to make sure your Appwrite data is compatible with any internal changes. \", \"As of version 0.14, Appwrite requires Docker Compose Version 2. To upgrade Appwrite, make sure your Docker installation is updated to support Composer V2.\", \" A Note About Migration At present, we support migrations only to the immediately higher versions, i.e from 0.6 to 0.7 and 0.7 to 0.8 and so on. So if you're trying to migrate from 0.6 to 0.8, you will first need to migrate to 0.7 and then to 0.8 It is highly recommended to backup your server data before running the migration. It is recommended to run the migration process on a dev instance and make sure your application is working well and that you have checked for any breaking changes in the new version changelog.\", \"The first step is to install the latest version of Appwrite. Head to the directory where you ran your previous Appwrite install command. \", \" parent_directory <= you run the command in this directory\\n \\u2514\\u2500\\u2500 appwrite\\n \\u2514\\u2500\\u2500 docker-compose.yml\", \"This is the parent directory where you will find the appwrite directory, inside which there are docker-compose.yml and .env files.\"]}, {\"level\": 3, \"title\": \"Installing the Next Version\", \"body\": [\" Unix docker run -it --rm \\\\\\n --volume /var/run/docker.sock:/var/run/docker.sock \\\\\\n --volume \\\"$(pwd)\\\"/appwrite:/usr/src/code/appwrite:rw \\\\\\n --entrypoint=\\\"install\\\" \\\\\\n appwrite/appwrite:1.3.7 CMD docker run -it --rm ^\\n --volume //var/run/docker.sock:/var/run/docker.sock ^\\n --volume \\\"%cd%\\\"/appwrite:/usr/src/code/appwrite:rw ^\\n --entrypoint=\\\"install\\\" ^\\n appwrite/appwrite:1.3.7 PowerShell docker run -it --rm `\\n --volume /var/run/docker.sock:/var/run/docker.sock `\\n --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `\\n --entrypoint=\\\"install\\\" `\\n appwrite/appwrite:1.3.7 \", \"This will pull the docker-compose.yml file for the new version and perform the installation. Once the setup completes, verify that you have the latest version of Appwrite.\", \" docker ps | grep appwrite/appwrite\", \"Verify that the STATUS doesn't have any errors and all the appwrite/appwrite containers have version : 1.3.7\"]}]", "metadata": {"source": "https://appwrite.io/docs/upgrade"}} \ No newline at end of file +{"page_content": "[{\"level\": 1, \"title\": \" Upgrade \", \"body\": [\"To upgrade your Appwrite server from an older version, you should use the Appwrite migration tool after you have installed the new version. The migration tool will adjust your Appwrite data to the new version's structure to make sure your Appwrite data is compatible with any internal changes. \", \"As of version 0.14, Appwrite requires Docker Compose Version 2. To upgrade Appwrite, make sure your Docker installation is updated to support Composer V2.\", \" A Note About Migration At present, we support migrations only to the immediately higher versions, i.e from 0.6 to 0.7 and 0.7 to 0.8 and so on. So if you're trying to migrate from 0.6 to 0.8, you will first need to migrate to 0.7 and then to 0.8 It is highly recommended to backup your server data before running the migration. It is recommended to run the migration process on a dev instance and make sure your application is working well and that you have checked for any breaking changes in the new version changelog.\", \"The first step is to install the latest version of Appwrite. Head to the directory where you ran your previous Appwrite install command. \", \" parent_directory <= you run the command in this directory\\n \\u2514\\u2500\\u2500 appwrite\\n \\u2514\\u2500\\u2500 docker-compose.yml\", \"This is the parent directory where you will find the appwrite directory, inside which there are docker-compose.yml and .env files.\"]}, {\"level\": 3, \"title\": \"Installing the Next Version\", \"body\": [\" Unix docker run -it --rm \\\\\\n --volume /var/run/docker.sock:/var/run/docker.sock \\\\\\n --volume \\\"$(pwd)\\\"/appwrite:/usr/src/code/appwrite:rw \\\\\\n --entrypoint=\\\"install\\\" \\\\\\n appwrite/appwrite:1.4.0 CMD docker run -it --rm ^\\n --volume //var/run/docker.sock:/var/run/docker.sock ^\\n --volume \\\"%cd%\\\"/appwrite:/usr/src/code/appwrite:rw ^\\n --entrypoint=\\\"install\\\" ^\\n appwrite/appwrite:1.4.0 PowerShell docker run -it --rm `\\n --volume /var/run/docker.sock:/var/run/docker.sock `\\n --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `\\n --entrypoint=\\\"install\\\" `\\n appwrite/appwrite:1.4.0 \", \"This will pull the docker-compose.yml file for the new version and perform the installation. Once the setup completes, verify that you have the latest version of Appwrite.\", \" docker ps | grep appwrite/appwrite\", \"Verify that the STATUS doesn't have any errors and all the appwrite/appwrite containers have version : 1.4.0\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/upgrade"}} \ No newline at end of file diff --git a/docs/4eede282-4583-11ee-9922-f2ea36f81204.json b/docs/4eede282-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..0202f97 --- /dev/null +++ b/docs/4eede282-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Production \", \"body\": [\"Appwrite's default setup is designed to help you start building with Appwrite quickly. To succeed with Appwrite in a production environment, you should follow a few basic concepts and best practices. This document assumes you have some basic understanding of Docker and Docker Compose command-line tools.\"]}, {\"level\": 2, \"title\": \"Encryption\", \"body\": [\"Appwrite does not generate a unique encryption key during a default setup. This key encrypts your files and sensitive data like webhook passwords or API keys to keep them secure. To take advantage of this feature, you must generate a unique key and set it as the value of the _APP_OPENSSL_KEY_V1 environment variable.\", \"You must set _APP_OPENSSL_KEY_V1 immediately after installation of a production Appwrite instance. Changing the _APP_OPENSSL_KEY_V1 variable will cause the loss of existing passwords, OAuth secrets, and API keys.\", \"Make sure to keep this key in a safe place and never make it publicly accessible.\", \" Best Practice You should always prefer HTTPS over HTTP in production environments. This keeps your APIs secure and prevents any redirects from interfering with your requests. You can force the use of HTTPS with the _APP_OPTIONS_FORCE_HTTPS environment variable.\"]}, {\"level\": 2, \"title\": \"Limit Console Access\", \"body\": [\"Appwrite provides three different methods to limit access to your Appwrite Console.\", \" Whitelist a group of developers by IP using the _APP_CONSOLE_WHITELIST_IPS environment variable. Whitelist a group of developers by email using the _APP_CONSOLE_WHITELIST_EMAILS environment variable. Only the root user can signup. All other developers must be added through invitations. This is configured using the _APP_CONSOLE_WHITELIST_ROOT environment variable.\", \"By default, only the first user can sign up on the Appwrite instance's dashboard. All other users must be added to the dashboard through invitation.\", \"Learn more about environment variables\"]}, {\"level\": 2, \"title\": \"Scaling\", \"body\": [\"Appwrite is built with scalability in mind. Appwrite can scale both horizontally and vertically.\", \"Each Appwrite instance is composed of many containers, each with its unique job. Appwrite's functions and worker containers are stateless. To scale them, all you need is to replicate them and set up a load balancer to distribute their load.\", \"If you decide to set up a load balancer to scale a container, make sure all communication are routed through the load balancer and not directly to the replicated containers. You can configure communicating between Appwrite containers using Docker environment variables.\", \"Three Appwrite containers are stateful. The MariaDB, Redis, and InfluxDB containers are used for storing data, cache and pub/sub messaging, and usage stats, respectively. To scale these containers, set up a standard cluster (same as you would with any other app using these technologies) according to your needs and performance.\"]}, {\"level\": 2, \"title\": \"Enable Rate Limits\", \"body\": [\"If you disabled rate limits during development, make sure you re-enable them when moving to production environments. Rate limiting can be enabled by setting the _APP_OPTIONS_ABUSE environment variable to enabled.\", \"Rate limits are an important mechanism to protect your app. Without rate limits, malicious actors can spam your APIs to perform denial-of-service type attacks or brute-force user passwords.\", \"Learn more about environment variables\"]}, {\"level\": 2, \"title\": \"Emails\", \"body\": [\"Sending emails is hard. There are a lot of spam rules and configurations to master in order to set up a functional SMTP server. While it is okay to use a self-hosted SMTP server during development, you should use a third-party SMTP provider for production so your email doesn't get labeled as spam.\", \"You can change Appwrite's SMTP settings and credentials to any 3rd party provider you like that supports SMTP integration using our Docker environment variables. Most SMTP providers offer a decent free tier to get started with.\"]}, {\"level\": 2, \"title\": \"Backups\", \"body\": [\"Backups are highly recommended for any production environment. Currently, there is no built-in script we provide to do this automatically. You must do the following to back up your Appwrite server data, stats, and files.\", \" Create a script to back up and restore the databases holding your Appwrite schemas. Note that trying to back up the database containers using a docker volume backup can result in a corrupted copy of your data. We recommend using the databases' built-in tools for this. Create a script to back up and restore your InfluxDB stats. If you don't care much about your server stats, you can skip this. Create a script to back up Appwrite storage volume. There are many online resources explaining different ways to backup a docker volume. When running on multiple servers, it is very recommended to use an attachable storage point. Some cloud providers offer integrated backups to such attachable mount like GCP, AWS, DigitalOcean, and the list continues. Create a script to back up .env and docker-compose.yml, which holds secrets and server configuration information.\", \" Docker Volume Backups Do not back up any stateful container using a docker volume backup, such as databases, Redis, or InfluxDB containers. This can result in corruption and permanent data loss.\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/production"}} \ No newline at end of file diff --git a/docs/4eede908-4583-11ee-9922-f2ea36f81204.json b/docs/4eede908-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..4ccecbc --- /dev/null +++ b/docs/4eede908-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/account?sdk=web-default"}} \ No newline at end of file diff --git a/docs/4eededfe-4583-11ee-9922-f2ea36f81204.json b/docs/4eededfe-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..a0dadd6 --- /dev/null +++ b/docs/4eededfe-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/teams?sdk=web-default"}} \ No newline at end of file diff --git a/docs/4eedf308-4583-11ee-9922-f2ea36f81204.json b/docs/4eedf308-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..ec38c35 --- /dev/null +++ b/docs/4eedf308-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/databases?sdk=web-default"}} \ No newline at end of file diff --git a/docs/4eedf84e-4583-11ee-9922-f2ea36f81204.json b/docs/4eedf84e-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..d5225d1 --- /dev/null +++ b/docs/4eedf84e-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/storage?sdk=web-default"}} \ No newline at end of file diff --git a/docs/4eedfdbc-4583-11ee-9922-f2ea36f81204.json b/docs/4eedfdbc-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..c7964dc --- /dev/null +++ b/docs/4eedfdbc-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/functions?sdk=web-default"}} \ No newline at end of file diff --git a/docs/4eee0280-4583-11ee-9922-f2ea36f81204.json b/docs/4eee0280-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..a7a8b7d --- /dev/null +++ b/docs/4eee0280-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/locale?sdk=web-default"}} \ No newline at end of file diff --git a/docs/4eee07bc-4583-11ee-9922-f2ea36f81204.json b/docs/4eee07bc-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..6744bcf --- /dev/null +++ b/docs/4eee07bc-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/client/avatars?sdk=web-default"}} \ No newline at end of file diff --git a/docs/4eee0e4c-4583-11ee-9922-f2ea36f81204.json b/docs/4eee0e4c-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..e30d801 --- /dev/null +++ b/docs/4eee0e4c-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/avatars"}} \ No newline at end of file diff --git a/docs/4eee132e-4583-11ee-9922-f2ea36f81204.json b/docs/4eee132e-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..d358cbe --- /dev/null +++ b/docs/4eee132e-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/avatars?sdk=nodejs-default"}} \ No newline at end of file diff --git a/docs/4eee17de-4583-11ee-9922-f2ea36f81204.json b/docs/4eee17de-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..2668ea9 --- /dev/null +++ b/docs/4eee17de-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/users?sdk=nodejs-default"}} \ No newline at end of file diff --git a/docs/4eee1c7a-4583-11ee-9922-f2ea36f81204.json b/docs/4eee1c7a-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..7a0e5df --- /dev/null +++ b/docs/4eee1c7a-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" User Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string User ID. $createdAt string User creation date in ISO 8601 format. $updatedAt string User update date in ISO 8601 format. name string User name. password string Hashed user password. hash string Password hashing algorithm. hashOptions algoArgon2algoScryptalgoScryptModifiedalgoBcryptalgoPhpassalgoShaalgoMd5 Password hashing algorithm configuration. registration string User registration date in ISO 8601 format. status boolean User status. Pass true for enabled and false for disabled. passwordUpdate string Password update time in ISO 8601 format. email string User email address. phone string User phone number in E.164 format. emailVerification boolean Email verification status. phoneVerification boolean Phone verification status. prefs preferences User preferences as a key-value object \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/user"}} \ No newline at end of file diff --git a/docs/4eee217a-4583-11ee-9922-f2ea36f81204.json b/docs/4eee217a-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..af1ea19 --- /dev/null +++ b/docs/4eee217a-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AlgoArgon2 Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description memoryCost integer Memory used to compute hash. timeCost integer Amount of time consumed to compute hash threads integer Number of threads used to compute hash. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/algoArgon2"}} \ No newline at end of file diff --git a/docs/4eee2666-4583-11ee-9922-f2ea36f81204.json b/docs/4eee2666-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..adff55b --- /dev/null +++ b/docs/4eee2666-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AlgoScrypt Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description costCpu integer CPU complexity of computed hash. costMemory integer Memory complexity of computed hash. costParallel integer Parallelization of computed hash. length integer Length used to compute hash. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/algoScrypt"}} \ No newline at end of file diff --git a/docs/4eee2b52-4583-11ee-9922-f2ea36f81204.json b/docs/4eee2b52-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..f55f5f5 --- /dev/null +++ b/docs/4eee2b52-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AlgoScryptModified Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description salt string Salt used to compute hash. saltSeparator string Separator used to compute hash. signerKey string Key used to compute hash. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/algoScryptModified"}} \ No newline at end of file diff --git a/docs/4eee3052-4583-11ee-9922-f2ea36f81204.json b/docs/4eee3052-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..a8d4578 --- /dev/null +++ b/docs/4eee3052-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AlgoBcrypt Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/algoBcrypt"}} \ No newline at end of file diff --git a/docs/4eee3520-4583-11ee-9922-f2ea36f81204.json b/docs/4eee3520-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..f95cfa4 --- /dev/null +++ b/docs/4eee3520-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AlgoPHPass Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/algoPhpass"}} \ No newline at end of file diff --git a/docs/4eee3a52-4583-11ee-9922-f2ea36f81204.json b/docs/4eee3a52-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..96bc028 --- /dev/null +++ b/docs/4eee3a52-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AlgoSHA Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/algoSha"}} \ No newline at end of file diff --git a/docs/4eee3f2a-4583-11ee-9922-f2ea36f81204.json b/docs/4eee3f2a-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..4157b4d --- /dev/null +++ b/docs/4eee3f2a-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AlgoMD5 Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/algoMd5"}} \ No newline at end of file diff --git a/docs/4eee4434-4583-11ee-9922-f2ea36f81204.json b/docs/4eee4434-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..dfe56d5 --- /dev/null +++ b/docs/4eee4434-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Preferences Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/preferences"}} \ No newline at end of file diff --git a/docs/4eee4c18-4583-11ee-9922-f2ea36f81204.json b/docs/4eee4c18-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..b88c271 --- /dev/null +++ b/docs/4eee4c18-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Users List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of users documents that matched your query. users user[] List of users. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/userList"}} \ No newline at end of file diff --git a/docs/4eee5118-4583-11ee-9922-f2ea36f81204.json b/docs/4eee5118-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..d8fca92 --- /dev/null +++ b/docs/4eee5118-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Sessions List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of sessions documents that matched your query. sessions session[] List of sessions. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/sessionList"}} \ No newline at end of file diff --git a/docs/4eee5640-4583-11ee-9922-f2ea36f81204.json b/docs/4eee5640-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..8ae3a69 --- /dev/null +++ b/docs/4eee5640-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Session Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Session ID. $createdAt string Session creation date in ISO 8601 format. userId string User ID. expire string Session expiration date in ISO 8601 format. provider string Session Provider. providerUid string Session Provider User ID. providerAccessToken string Session Provider Access Token. providerAccessTokenExpiry string The date of when the access token expires in ISO 8601 format. providerRefreshToken string Session Provider Refresh Token. ip string IP in use when the session was created. osCode string Operating system code name. View list of available options. osName string Operating system name. osVersion string Operating system version. clientType string Client type. clientCode string Client code name. View list of available options. clientName string Client name. clientVersion string Client version. clientEngine string Client engine name. clientEngineVersion string Client engine name. deviceName string Device name. deviceBrand string Device brand name. deviceModel string Device model name. countryCode string Country two-character ISO 3166-1 alpha code. countryName string Country name. current boolean Returns true if this the current user session. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/session"}} \ No newline at end of file diff --git a/docs/4eee5b36-4583-11ee-9922-f2ea36f81204.json b/docs/4eee5b36-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..4342616 --- /dev/null +++ b/docs/4eee5b36-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Memberships List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of memberships documents that matched your query. memberships membership[] List of memberships. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/membershipList"}} \ No newline at end of file diff --git a/docs/4eee600e-4583-11ee-9922-f2ea36f81204.json b/docs/4eee600e-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..bb4f2c4 --- /dev/null +++ b/docs/4eee600e-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Membership Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Membership ID. $createdAt string Membership creation date in ISO 8601 format. $updatedAt string Membership update date in ISO 8601 format. userId string User ID. userName string User name. userEmail string User email address. teamId string Team ID. teamName string Team name. invited string Date, the user has been invited to join the team in ISO 8601 format. joined string Date, the user has accepted the invitation to join the team in ISO 8601 format. confirm boolean User confirmation status, true if the user has joined the team or false otherwise. roles string[] User list of roles \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/membership"}} \ No newline at end of file diff --git a/docs/4eee6586-4583-11ee-9922-f2ea36f81204.json b/docs/4eee6586-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..b42c36d --- /dev/null +++ b/docs/4eee6586-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Logs List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of logs documents that matched your query. logs log[] List of logs. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/logList"}} \ No newline at end of file diff --git a/docs/4eee6aea-4583-11ee-9922-f2ea36f81204.json b/docs/4eee6aea-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..28c14c7 --- /dev/null +++ b/docs/4eee6aea-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Log Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description event string Event name. userId string User ID. userEmail string User Email. userName string User Name. mode string API mode when event triggered. ip string IP session in use when the session was created. time string Log creation date in ISO 8601 format. osCode string Operating system code name. View list of available options. osName string Operating system name. osVersion string Operating system version. clientType string Client type. clientCode string Client code name. View list of available options. clientName string Client name. clientVersion string Client version. clientEngine string Client engine name. clientEngineVersion string Client engine name. deviceName string Device name. deviceBrand string Device brand name. deviceModel string Device model name. countryCode string Country two-character ISO 3166-1 alpha code. countryName string Country name. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/log"}} \ No newline at end of file diff --git a/docs/4eee7012-4583-11ee-9922-f2ea36f81204.json b/docs/4eee7012-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..1d8407e --- /dev/null +++ b/docs/4eee7012-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/locale"}} \ No newline at end of file diff --git a/docs/4eee74a4-4583-11ee-9922-f2ea36f81204.json b/docs/4eee74a4-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..501fec6 --- /dev/null +++ b/docs/4eee74a4-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/locale?sdk=nodejs-default"}} \ No newline at end of file diff --git a/docs/4eee7972-4583-11ee-9922-f2ea36f81204.json b/docs/4eee7972-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..e6c2f71 --- /dev/null +++ b/docs/4eee7972-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Locale Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description ip string User IP address. countryCode string Country code in ISO 3166-1 two-character format country string Country name. This field support localization. continentCode string Continent code. A two character continent code \\\"AF\\\" for Africa, \\\"AN\\\" for Antarctica, \\\"AS\\\" for Asia, \\\"EU\\\" for Europe, \\\"NA\\\" for North America, \\\"OC\\\" for Oceania, and \\\"SA\\\" for South America. continent string Continent name. This field support localization. eu boolean True if country is part of the Europian Union. currency string Currency code in ISO 4217-1 three-character format \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/locale"}} \ No newline at end of file diff --git a/docs/4eee7e4a-4583-11ee-9922-f2ea36f81204.json b/docs/4eee7e4a-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..6c13441 --- /dev/null +++ b/docs/4eee7e4a-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Countries List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of countries documents that matched your query. countries country[] List of countries. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/countryList"}} \ No newline at end of file diff --git a/docs/4eee8304-4583-11ee-9922-f2ea36f81204.json b/docs/4eee8304-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..5221915 --- /dev/null +++ b/docs/4eee8304-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Country Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description name string Country name. code string Country two-character ISO 3166-1 alpha code. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/country"}} \ No newline at end of file diff --git a/docs/4eee8854-4583-11ee-9922-f2ea36f81204.json b/docs/4eee8854-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..7dcb16d --- /dev/null +++ b/docs/4eee8854-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Phones List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of phones documents that matched your query. phones phone[] List of phones. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/phoneList"}} \ No newline at end of file diff --git a/docs/4eee8db8-4583-11ee-9922-f2ea36f81204.json b/docs/4eee8db8-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..8a2911b --- /dev/null +++ b/docs/4eee8db8-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Phone Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description code string Phone code. countryCode string Country two-character ISO 3166-1 alpha code. countryName string Country name. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/phone"}} \ No newline at end of file diff --git a/docs/4eee931c-4583-11ee-9922-f2ea36f81204.json b/docs/4eee931c-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..d6ef041 --- /dev/null +++ b/docs/4eee931c-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Continents List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of continents documents that matched your query. continents continent[] List of continents. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/continentList"}} \ No newline at end of file diff --git a/docs/4eee988a-4583-11ee-9922-f2ea36f81204.json b/docs/4eee988a-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..8aac0ed --- /dev/null +++ b/docs/4eee988a-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Continent Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description name string Continent name. code string Continent two letter code. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/continent"}} \ No newline at end of file diff --git a/docs/4eee9d1c-4583-11ee-9922-f2ea36f81204.json b/docs/4eee9d1c-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..8bc3d12 --- /dev/null +++ b/docs/4eee9d1c-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Currencies List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of currencies documents that matched your query. currencies currency[] List of currencies. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/currencyList"}} \ No newline at end of file diff --git a/docs/4eeea1b8-4583-11ee-9922-f2ea36f81204.json b/docs/4eeea1b8-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..248ed47 --- /dev/null +++ b/docs/4eeea1b8-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Currency Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description symbol string Currency symbol. name string Currency name. symbolNative string Currency native symbol. decimalDigits integer Number of decimal digits. rounding number Currency digit rounding. code string Currency code in ISO 4217-1 three-character format. namePlural string Currency plural name \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/currency"}} \ No newline at end of file diff --git a/docs/4eeea654-4583-11ee-9922-f2ea36f81204.json b/docs/4eeea654-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..7d9fa0f --- /dev/null +++ b/docs/4eeea654-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Languages List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of languages documents that matched your query. languages language[] List of languages. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/languageList"}} \ No newline at end of file diff --git a/docs/4eeeab4a-4583-11ee-9922-f2ea36f81204.json b/docs/4eeeab4a-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..23b1d6b --- /dev/null +++ b/docs/4eeeab4a-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Language Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description name string Language name. code string Language two-character ISO 639-1 codes. nativeName string Language native name. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/language"}} \ No newline at end of file diff --git a/docs/4eeeb040-4583-11ee-9922-f2ea36f81204.json b/docs/4eeeb040-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..6a7b754 --- /dev/null +++ b/docs/4eeeb040-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/functions"}} \ No newline at end of file diff --git a/docs/4eeeb4f0-4583-11ee-9922-f2ea36f81204.json b/docs/4eeeb4f0-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..aa78ba7 --- /dev/null +++ b/docs/4eeeb4f0-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/functions?sdk=nodejs-default"}} \ No newline at end of file diff --git a/docs/4eeeb978-4583-11ee-9922-f2ea36f81204.json b/docs/4eeeb978-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..7b92db2 --- /dev/null +++ b/docs/4eeeb978-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Function Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Function ID. $createdAt string Function creation date in ISO 8601 format. $updatedAt string Function update date in ISO 8601 format. execute string[] Execution permissions. name string Function name. enabled boolean Function enabled. runtime string Function execution runtime. deployment string Function's active deployment ID. vars variable[] Function variables. events string[] Function trigger events. schedule string Function execution schedult in CRON format. scheduleNext string Function's next scheduled execution time in ISO 8601 format. schedulePrevious string Function's previous scheduled execution time in ISO 8601 format. timeout integer Function execution timeout in seconds. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/function"}} \ No newline at end of file diff --git a/docs/4eeebe46-4583-11ee-9922-f2ea36f81204.json b/docs/4eeebe46-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..a0535bf --- /dev/null +++ b/docs/4eeebe46-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Variable Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Variable ID. $createdAt string Variable creation date in ISO 8601 format. $updatedAt string Variable creation date in ISO 8601 format. key string Variable key. value string Variable value. functionId string Function ID. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/variable"}} \ No newline at end of file diff --git a/docs/4eeec2ec-4583-11ee-9922-f2ea36f81204.json b/docs/4eeec2ec-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..def8247 --- /dev/null +++ b/docs/4eeec2ec-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Functions List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of functions documents that matched your query. functions function[] List of functions. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/functionList"}} \ No newline at end of file diff --git a/docs/4eeecb02-4583-11ee-9922-f2ea36f81204.json b/docs/4eeecb02-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..2ca2eb0 --- /dev/null +++ b/docs/4eeecb02-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Runtimes List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of runtimes documents that matched your query. runtimes runtime[] List of runtimes. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/runtimeList"}} \ No newline at end of file diff --git a/docs/4eeed03e-4583-11ee-9922-f2ea36f81204.json b/docs/4eeed03e-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..ddeb0ca --- /dev/null +++ b/docs/4eeed03e-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Runtime Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Runtime ID. name string Runtime Name. version string Runtime version. base string Base Docker image used to build the runtime. image string Image name of Docker Hub. logo string Name of the logo image. supports string[] List of supported architectures. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/runtime"}} \ No newline at end of file diff --git a/docs/4eeed570-4583-11ee-9922-f2ea36f81204.json b/docs/4eeed570-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..9de8a07 --- /dev/null +++ b/docs/4eeed570-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Deployment Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Deployment ID. $createdAt string Deployment creation date in ISO 8601 format. $updatedAt string Deployment update date in ISO 8601 format. resourceId string Resource ID. resourceType string Resource type. entrypoint string The entrypoint file to use to execute the deployment code. size integer The code size in bytes. buildId string The current build ID. activate boolean Whether the deployment should be automatically activated. status string The deployment status. Possible values are \\\"processing\\\", \\\"building\\\", \\\"pending\\\", \\\"ready\\\", and \\\"failed\\\". buildStdout string The build stdout. buildStderr string The build stderr. buildTime integer The current build time in seconds. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/deployment"}} \ No newline at end of file diff --git a/docs/4eeeda70-4583-11ee-9922-f2ea36f81204.json b/docs/4eeeda70-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..c0d8099 --- /dev/null +++ b/docs/4eeeda70-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Deployments List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of deployments documents that matched your query. deployments deployment[] List of deployments. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/deploymentList"}} \ No newline at end of file diff --git a/docs/4eeedf2a-4583-11ee-9922-f2ea36f81204.json b/docs/4eeedf2a-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..f999cb4 --- /dev/null +++ b/docs/4eeedf2a-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Execution Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Execution ID. $createdAt string Execution creation date in ISO 8601 format. $updatedAt string Execution upate date in ISO 8601 format. $permissions string[] Execution roles. functionId string Function ID. trigger string The trigger that caused the function to execute. Possible values can be: http, schedule, or event. status string The status of the function execution. Possible values can be: waiting, processing, completed, or failed. statusCode integer The script status code. response string The script response output string. Logs the last 4,000 characters of the execution response output. stdout string The script stdout output string. Logs the last 4,000 characters of the execution stdout output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. stderr string The script stderr output string. Logs the last 4,000 characters of the execution stderr output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. duration number The script execution duration in seconds. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/execution"}} \ No newline at end of file diff --git a/docs/4eeee45c-4583-11ee-9922-f2ea36f81204.json b/docs/4eeee45c-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..0d91030 --- /dev/null +++ b/docs/4eeee45c-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Executions List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of executions documents that matched your query. executions execution[] List of executions. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/executionList"}} \ No newline at end of file diff --git a/docs/4eeee8e4-4583-11ee-9922-f2ea36f81204.json b/docs/4eeee8e4-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..0699b05 --- /dev/null +++ b/docs/4eeee8e4-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Variables List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of variables documents that matched your query. variables variable[] List of variables. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/variableList"}} \ No newline at end of file diff --git a/docs/4eeeeda8-4583-11ee-9922-f2ea36f81204.json b/docs/4eeeeda8-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..4311d73 --- /dev/null +++ b/docs/4eeeeda8-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/storage"}} \ No newline at end of file diff --git a/docs/4eeef226-4583-11ee-9922-f2ea36f81204.json b/docs/4eeef226-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..abb833c --- /dev/null +++ b/docs/4eeef226-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/storage?sdk=nodejs-default"}} \ No newline at end of file diff --git a/docs/4eeef73a-4583-11ee-9922-f2ea36f81204.json b/docs/4eeef73a-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..bdf4caf --- /dev/null +++ b/docs/4eeef73a-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Bucket Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Bucket ID. $createdAt string Bucket creation time in ISO 8601 format. $updatedAt string Bucket update date in ISO 8601 format. $permissions string[] Bucket permissions. Learn more about permissions. fileSecurity boolean Whether file-level security is enabled. Learn more about permissions. name string Bucket name. enabled boolean Bucket enabled. maximumFileSize integer Maximum file size supported. allowedFileExtensions string[] Allowed file extensions. compression string Compression algorithm choosen for compression. Will be one of none, gzip, or zstd. encryption boolean Bucket is encrypted. antivirus boolean Virus scanning is enabled. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/bucket"}} \ No newline at end of file diff --git a/docs/4eeefc4e-4583-11ee-9922-f2ea36f81204.json b/docs/4eeefc4e-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..43cc96d --- /dev/null +++ b/docs/4eeefc4e-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Buckets List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of buckets documents that matched your query. buckets bucket[] List of buckets. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/bucketList"}} \ No newline at end of file diff --git a/docs/4eef00fe-4583-11ee-9922-f2ea36f81204.json b/docs/4eef00fe-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..a28a980 --- /dev/null +++ b/docs/4eef00fe-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" File Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string File ID. bucketId string Bucket ID. $createdAt string File creation date in ISO 8601 format. $updatedAt string File update date in ISO 8601 format. $permissions string[] File permissions. Learn more about permissions. name string File name. signature string File MD5 signature. mimeType string File mime type. sizeOriginal integer File original size in bytes. chunksTotal integer Total number of chunks available chunksUploaded integer Total number of chunks uploaded \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/file"}} \ No newline at end of file diff --git a/docs/4eef05d6-4583-11ee-9922-f2ea36f81204.json b/docs/4eef05d6-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..4b47df5 --- /dev/null +++ b/docs/4eef05d6-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Files List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of files documents that matched your query. files file[] List of files. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/fileList"}} \ No newline at end of file diff --git a/docs/4eef0a72-4583-11ee-9922-f2ea36f81204.json b/docs/4eef0a72-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..3a150ca --- /dev/null +++ b/docs/4eef0a72-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/databases"}} \ No newline at end of file diff --git a/docs/4eef0edc-4583-11ee-9922-f2ea36f81204.json b/docs/4eef0edc-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..f5fdce1 --- /dev/null +++ b/docs/4eef0edc-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/databases?sdk=nodejs-default"}} \ No newline at end of file diff --git a/docs/4eef1332-4583-11ee-9922-f2ea36f81204.json b/docs/4eef1332-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..41f388e --- /dev/null +++ b/docs/4eef1332-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Database Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Database ID. name string Database name. $createdAt string Database creation date in ISO 8601 format. $updatedAt string Database update date in ISO 8601 format. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/database"}} \ No newline at end of file diff --git a/docs/4eef17b0-4583-11ee-9922-f2ea36f81204.json b/docs/4eef17b0-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..785e197 --- /dev/null +++ b/docs/4eef17b0-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Databases List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of databases documents that matched your query. databases database[] List of databases. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/databaseList"}} \ No newline at end of file diff --git a/docs/4eef1c24-4583-11ee-9922-f2ea36f81204.json b/docs/4eef1c24-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..9be3519 --- /dev/null +++ b/docs/4eef1c24-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Collection Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Collection ID. $createdAt string Collection creation date in ISO 8601 format. $updatedAt string Collection update date in ISO 8601 format. $permissions string[] Collection permissions. Learn more about permissions. databaseId string Database ID. name string Collection name. enabled boolean Collection enabled. documentSecurity boolean Whether document-level permissions are enabled. Learn more about permissions. attributes array of attributeBooleanattributeIntegerattributeFloatattributeEmailattributeEnumattributeUrlattributeIpattributeDatetimeattributeString Collection attributes. indexes index[] Collection indexes. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/collection"}} \ No newline at end of file diff --git a/docs/4eef20fc-4583-11ee-9922-f2ea36f81204.json b/docs/4eef20fc-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..655af0d --- /dev/null +++ b/docs/4eef20fc-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AttributeBoolean Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description key string Attribute Key. type string Attribute type. status string Attribute status. Possible values: available, processing, deleting, stuck, or failed required boolean Is attribute required? array boolean Is attribute an array? default boolean Default value for attribute when not provided. Cannot be set when attribute is required. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/attributeBoolean"}} \ No newline at end of file diff --git a/docs/4eef25a2-4583-11ee-9922-f2ea36f81204.json b/docs/4eef25a2-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..92593cb --- /dev/null +++ b/docs/4eef25a2-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AttributeInteger Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description key string Attribute Key. type string Attribute type. status string Attribute status. Possible values: available, processing, deleting, stuck, or failed required boolean Is attribute required? array boolean Is attribute an array? min integer Minimum value to enforce for new documents. max integer Maximum value to enforce for new documents. default integer Default value for attribute when not provided. Cannot be set when attribute is required. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/attributeInteger"}} \ No newline at end of file diff --git a/docs/4eef2a7a-4583-11ee-9922-f2ea36f81204.json b/docs/4eef2a7a-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..fe65ffc --- /dev/null +++ b/docs/4eef2a7a-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AttributeFloat Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description key string Attribute Key. type string Attribute type. status string Attribute status. Possible values: available, processing, deleting, stuck, or failed required boolean Is attribute required? array boolean Is attribute an array? min number Minimum value to enforce for new documents. max number Maximum value to enforce for new documents. default number Default value for attribute when not provided. Cannot be set when attribute is required. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/attributeFloat"}} \ No newline at end of file diff --git a/docs/4eef2eee-4583-11ee-9922-f2ea36f81204.json b/docs/4eef2eee-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..c9a2d82 --- /dev/null +++ b/docs/4eef2eee-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AttributeEmail Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description key string Attribute Key. type string Attribute type. status string Attribute status. Possible values: available, processing, deleting, stuck, or failed required boolean Is attribute required? array boolean Is attribute an array? format string String format. default string Default value for attribute when not provided. Cannot be set when attribute is required. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/attributeEmail"}} \ No newline at end of file diff --git a/docs/4eef336c-4583-11ee-9922-f2ea36f81204.json b/docs/4eef336c-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..efa3728 --- /dev/null +++ b/docs/4eef336c-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AttributeEnum Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description key string Attribute Key. type string Attribute type. status string Attribute status. Possible values: available, processing, deleting, stuck, or failed required boolean Is attribute required? array boolean Is attribute an array? elements string[] Array of elements in enumerated type. format string String format. default string Default value for attribute when not provided. Cannot be set when attribute is required. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/attributeEnum"}} \ No newline at end of file diff --git a/docs/4eef37ea-4583-11ee-9922-f2ea36f81204.json b/docs/4eef37ea-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..83433a2 --- /dev/null +++ b/docs/4eef37ea-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AttributeURL Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description key string Attribute Key. type string Attribute type. status string Attribute status. Possible values: available, processing, deleting, stuck, or failed required boolean Is attribute required? array boolean Is attribute an array? format string String format. default string Default value for attribute when not provided. Cannot be set when attribute is required. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/attributeUrl"}} \ No newline at end of file diff --git a/docs/4eef3c54-4583-11ee-9922-f2ea36f81204.json b/docs/4eef3c54-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..615c8f4 --- /dev/null +++ b/docs/4eef3c54-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AttributeIP Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description key string Attribute Key. type string Attribute type. status string Attribute status. Possible values: available, processing, deleting, stuck, or failed required boolean Is attribute required? array boolean Is attribute an array? format string String format. default string Default value for attribute when not provided. Cannot be set when attribute is required. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/attributeIp"}} \ No newline at end of file diff --git a/docs/4eef43de-4583-11ee-9922-f2ea36f81204.json b/docs/4eef43de-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..729a2c7 --- /dev/null +++ b/docs/4eef43de-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AttributeDatetime Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description key string Attribute Key. type string Attribute type. status string Attribute status. Possible values: available, processing, deleting, stuck, or failed required boolean Is attribute required? array boolean Is attribute an array? format string ISO 8601 format. default string Default value for attribute when not provided. Only null is optional \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/attributeDatetime"}} \ No newline at end of file diff --git a/docs/4eef4848-4583-11ee-9922-f2ea36f81204.json b/docs/4eef4848-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..23fb458 --- /dev/null +++ b/docs/4eef4848-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" AttributeString Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description key string Attribute Key. type string Attribute type. status string Attribute status. Possible values: available, processing, deleting, stuck, or failed required boolean Is attribute required? array boolean Is attribute an array? size integer Attribute size. default string Default value for attribute when not provided. Cannot be set when attribute is required. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/attributeString"}} \ No newline at end of file diff --git a/docs/4eef4cd0-4583-11ee-9922-f2ea36f81204.json b/docs/4eef4cd0-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..288330e --- /dev/null +++ b/docs/4eef4cd0-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Index Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description key string Index Key. type string Index type. status string Index status. Possible values: available, processing, deleting, stuck, or failed attributes string[] Index attributes. orders string[] Index orders. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/index"}} \ No newline at end of file diff --git a/docs/4eef5144-4583-11ee-9922-f2ea36f81204.json b/docs/4eef5144-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..d9ac83c --- /dev/null +++ b/docs/4eef5144-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Collections List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of collections documents that matched your query. collections collection[] List of collections. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/collectionList"}} \ No newline at end of file diff --git a/docs/4eef55d6-4583-11ee-9922-f2ea36f81204.json b/docs/4eef55d6-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..de11dd7 --- /dev/null +++ b/docs/4eef55d6-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Attributes List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of attributes in the given collection. attributes array of attributeBooleanattributeIntegerattributeFloatattributeEmailattributeEnumattributeUrlattributeIpattributeDatetimeattributeString List of attributes. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/attributeList"}} \ No newline at end of file diff --git a/docs/4eef5a40-4583-11ee-9922-f2ea36f81204.json b/docs/4eef5a40-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..8ddaa89 --- /dev/null +++ b/docs/4eef5a40-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Indexes List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of indexes documents that matched your query. indexes index[] List of indexes. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/indexList"}} \ No newline at end of file diff --git a/docs/4eef5e82-4583-11ee-9922-f2ea36f81204.json b/docs/4eef5e82-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..93ba826 --- /dev/null +++ b/docs/4eef5e82-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Document Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Document ID. $collectionId string Collection ID. $databaseId string Database ID. $createdAt string Document creation date in ISO 8601 format. $updatedAt string Document update date in ISO 8601 format. $permissions string[] Document permissions. Learn more about permissions. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/document"}} \ No newline at end of file diff --git a/docs/4eef62d8-4583-11ee-9922-f2ea36f81204.json b/docs/4eef62d8-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..456bfe5 --- /dev/null +++ b/docs/4eef62d8-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Documents List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of documents documents that matched your query. documents document[] List of documents. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/documentList"}} \ No newline at end of file diff --git a/docs/4eef66fc-4583-11ee-9922-f2ea36f81204.json b/docs/4eef66fc-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..62d3e4f --- /dev/null +++ b/docs/4eef66fc-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/teams"}} \ No newline at end of file diff --git a/docs/4eef6b5c-4583-11ee-9922-f2ea36f81204.json b/docs/4eef6b5c-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..10a9bdf --- /dev/null +++ b/docs/4eef6b5c-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/teams?sdk=nodejs-default"}} \ No newline at end of file diff --git a/docs/4eef6f94-4583-11ee-9922-f2ea36f81204.json b/docs/4eef6f94-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..00fb290 --- /dev/null +++ b/docs/4eef6f94-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Team Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Team ID. $createdAt string Team creation date in ISO 8601 format. $updatedAt string Team update date in ISO 8601 format. name string Team name. total integer Total number of team members. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/team"}} \ No newline at end of file diff --git a/docs/4eef73a4-4583-11ee-9922-f2ea36f81204.json b/docs/4eef73a4-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..9093b77 --- /dev/null +++ b/docs/4eef73a4-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Teams List Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description total integer Total number of teams documents that matched your query. teams team[] List of teams. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/teamList"}} \ No newline at end of file diff --git a/docs/4eef77dc-4583-11ee-9922-f2ea36f81204.json b/docs/4eef77dc-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..37392cf --- /dev/null +++ b/docs/4eef77dc-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/account"}} \ No newline at end of file diff --git a/docs/4eef7c0a-4583-11ee-9922-f2ea36f81204.json b/docs/4eef7c0a-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..efe58fa --- /dev/null +++ b/docs/4eef7c0a-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/server/account?sdk=nodejs-default"}} \ No newline at end of file diff --git a/docs/4eef8060-4583-11ee-9922-f2ea36f81204.json b/docs/4eef8060-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..bdc3143 --- /dev/null +++ b/docs/4eef8060-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Account Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string User ID. $createdAt string User creation date in ISO 8601 format. $updatedAt string User update date in ISO 8601 format. name string User name. registration string User registration date in ISO 8601 format. status boolean User status. Pass true for enabled and false for disabled. passwordUpdate string Password update time in ISO 8601 format. email string User email address. phone string User phone number in E.164 format. emailVerification boolean Email verification status. phoneVerification boolean Phone verification status. prefs preferences User preferences as a key-value object \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/account"}} \ No newline at end of file diff --git a/docs/4eef851a-4583-11ee-9922-f2ea36f81204.json b/docs/4eef851a-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..6d6482b --- /dev/null +++ b/docs/4eef851a-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Token Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description $id string Token ID. $createdAt string Token creation date in ISO 8601 format. userId string User ID. secret string Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. expire string Token expiration date in ISO 8601 format. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/token"}} \ No newline at end of file diff --git a/docs/4eef890c-4583-11ee-9922-f2ea36f81204.json b/docs/4eef890c-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..b30a543 --- /dev/null +++ b/docs/4eef890c-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" JWT Object \", \"body\": []}, {\"level\": 2, \"title\": \"Properties\", \"body\": [\" Name Type Description jwt string JWT encoded string. \"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/models/jwt"}} \ No newline at end of file diff --git a/docs/4eef8cf4-4583-11ee-9922-f2ea36f81204.json b/docs/4eef8cf4-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..ad93d2d --- /dev/null +++ b/docs/4eef8cf4-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "\" Appwrite - Error We're having lots of fun on Discord! Come and join us! \\ud83d\\udcac

Error 400

Invalid page: Value must be one of (server, client, models)

Type

general_server_error

\"", "metadata": {"source": "http://167.172.175.165:2080/docs//server/users"}} \ No newline at end of file diff --git a/docs/4eef994c-4583-11ee-9922-f2ea36f81204.json b/docs/4eef994c-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..19a1d59 --- /dev/null +++ b/docs/4eef994c-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/account"}} \ No newline at end of file diff --git a/docs/4eef9dca-4583-11ee-9922-f2ea36f81204.json b/docs/4eef9dca-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..d7c941c --- /dev/null +++ b/docs/4eef9dca-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[]", "metadata": {"source": "http://167.172.175.165:2080/docs/"}} \ No newline at end of file diff --git a/docs/4eefa1da-4583-11ee-9922-f2ea36f81204.json b/docs/4eefa1da-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..d78fba7 --- /dev/null +++ b/docs/4eefa1da-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "[{\"level\": 1, \"title\": \" Permissions \", \"body\": [\"Appwrite permission mechanism offers a simple, yet flexible way to manage which users, teams, or roles can access a specific resource in your project, like documents and files.\", \"Using permissions, you can decide that only user A and user B will have read and update access to a specific database document, while user C and team X will be the only ones with delete access.\", \"As the name suggests, read permission allows a user to read a resource, create allows users to create new resources, update allows a user to make changes to a resource, and delete allows the user to remove the resource.\", \"All permissions can be granted to individuals or groups of users, entire teams, or only to team members with a specific role. Permission can also be granted based on authentication status such as to all users, only authenticated users, or only guest users.\", \"A project user can only grant a resource with permissions that they own. For example, if a user is trying to share a document with a team that they are not a member of, they will encounter a 401 not authorized error. If your app needs users to grant access to teams they're not a member of, you can create Appwrite Functions with a Server SDK to achieve this functionality.\", \" Appwrite Resource An Appwrite resource can be a database, collection, document, bucket, or file. Each resource has its own set of permissions to define who can interact with it. Using the Appwrite permissions mechanism, you can grant resource access to users, teams, and members with different roles.\"]}, {\"level\": 2, \"title\": \"Default Values\", \"body\": [\"If you create a resource using a Server SDK or the Appwrite Console without explicit permissions, no one can access it by default because the permissions will be empty. If you create a resource using a Client SDK without explicit permissions, the creator will be granted read, update, and delete permissions on that resource by default.\"]}, {\"level\": 2, \"title\": \"Server Integration\", \"body\": [\"Server integrations can be used for increased flexibility. When using a Server SDK in combination with the proper API key scopes, you can have any type of access to any of your project resources regardless of their permissions.\", \"Using the server integration flexibility, you can change resource permissions, share resources between different users and teams, or edit and delete them without any limitations.\"]}, {\"level\": 2, \"title\": \"Permission Types\", \"body\": [\"In Client and Server SDKs, you will find a Permission class with helper methods for each role described below.\", \" Type Description Permission.read() Access to read a resource. Permission.create() Access to create new resources. Does not apply to files or documents. Applying this type of access to files or documents results in an error. Permission.update() Access to change a resource, but not remove or create new resources. Does not apply to functions. Permission.delete() Access to remove a resource. Does not apply to functions. Permission.write() Alias to grant create, update, and delete access for collections and buckets and update and delete access for documents and files. \"]}, {\"level\": 2, \"title\": \"Permission Roles\", \"body\": [\"In Client and Server SDKs, you will find a Role class with helper methods for each role described below.\", \" Type Description Role.any() Grants access to anyone. Role.guests() Grants access to any guest user without a session. Authenticated users don't have access to this role. Role.users([STATUS]) Grants access to any authenticated or anonymous user. You can optionally pass the verified or unverified string to target specific types of users. Role.user([USER_ID], [STATUS]) Grants access to a specific user by user ID. You can optionally pass the verified or unverified string to target specific types of users. Role.team([TEAM_ID]) Grants access to any member of the specific team. To gain access to this permission, the user must be the team creator (owner), or receive and accept an invitation to join this team. Role.team([TEAM_ID], [ROLE]) Grants access to any member who possesses a specific role in a team. To gain access to this permission, the user must be a member of the specific team and have the given role assigned to them. Team roles can be assigned when inviting a user to become a team member. Role.member([MEMBERSHIP_ID]) Grants access to a specific member of a team. When the member is removed from the team, they will no longer have access. \"]}, {\"level\": 2, \"title\": \"Examples\", \"body\": [\"The examples below will show you how you can use the different Appwrite permissions to manage access control to your project resources.\", \"The following examples are using the Appwrite Web SDK but can be applied similarly to any of the other Appwrite SDKs.\"]}, {\"level\": 3, \"title\": \"Example #1 - Basic Usage\", \"body\": [\"In the following example, we are creating a document that can be read by anyone, edited by writers or admins, and deleted by administrators or a user with the user ID user:5c1f88b42259e.\", \" import { Client, Databases, Permission, Role } from \\\"appwrite\\\";\\n \\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n\\nlet promise = databases.createDocument(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n {'actorName': 'Chris Evans', 'height': 183},\\n [\\n Permission.read(Role.any()), // Anyone can view this document\\n Permission.update(Role.team(\\\"writers\\\")), // Writers can update this document\\n Permission.update(Role.team(\\\"admin\\\")), // Admins can update this document\\n Permission.delete(Role.user(\\\"5c1f88b42259e\\\")) // User 5c1f88b42259e can delete this document\\n Permission.delete(Role.team(\\\"admin\\\")) // Admins can delete this document\\n ]\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n});\"]}]", "metadata": {"source": "http://167.172.175.165:2080/docs/permissions/"}} \ No newline at end of file diff --git a/docs/4eefa6c6-4583-11ee-9922-f2ea36f81204.json b/docs/4eefa6c6-4583-11ee-9922-f2ea36f81204.json new file mode 100644 index 0000000..2b4aabf --- /dev/null +++ b/docs/4eefa6c6-4583-11ee-9922-f2ea36f81204.json @@ -0,0 +1 @@ +{"page_content": "\" Appwrite - Error We're having lots of fun on Discord! Come and join us! \\ud83d\\udcac

Error 404

Page not found

Type

general_server_error

\"", "metadata": {"source": "http://167.172.175.165:2080/docs/commandline-ci"}} \ No newline at end of file diff --git a/docs/8c2a1004-f62c-11ed-8355-0242c0a89002.json b/docs/8c2a1004-f62c-11ed-8355-0242c0a89002.json deleted file mode 100644 index 5cd25a2..0000000 --- a/docs/8c2a1004-f62c-11ed-8355-0242c0a89002.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Functions \", \"body\": [\"Appwrite Functions allow you to extend and customize your Appwrite server functionality by executing your custom code. Appwrite can execute your custom code in response to any Appwrite system event like account creation, user login, or document update. You can also schedule your functions or start them manually by triggering your function from an HTTP endpoint using the Appwrite client or server APIs.\", \"Appwrite Functions run in a secure, isolated Docker container. By default, Appwrite supports multiple runtimes for different languages that you can use to run your code.\"]}, {\"level\": 2, \"title\": \"Getting Started\", \"body\": [\"The quickest way to get started with Appwrite Functions is using the Appwrite CLI. The CLI comes with starter code and some simple commands to quickly create and deploy your functions. Once you have the CLI installed and setup with an Appwrite project, create your first function using: \", \" appwrite init function\", \"Give your function a name and choose your runtime. This will create a new starter function in the current directory and also add it to your appwrite.json file. Go ahead and deploy your function using :\", \" appwrite deploy function\", \"You can now head over to your Appwrite Dashboard, navigate to the Function settings and execute your function. You can find the status of your execution under the Logs tab. \", \"Feel free to modify and play around with the starter code and use the appwrite deploy command to instantly deploy your changes to the Appwrite server. \", \" The following sections will dive deeper into some more terminology and advanced concepts which can be useful when writing your function from scratch.\"]}, {\"level\": 2, \"title\": \"Writing your own Function\", \"body\": [\"When writing your own Appwrite Function, you must export the code in certain ways depending on the language. This varies between languages so refer to the examples below.\", \" Node.js module.exports = async (req, res) => {\\n const payload =\\n req.payload ||\\n 'No payload provided. Add custom data when executing function.';\\n\\n const secretKey =\\n req.variables.SECRET_KEY ||\\n 'SECRET_KEY variable not found. You can set it in Function settings.';\\n\\n const randomNumber = Math.random();\\n\\n const trigger = req.variables.APPWRITE_FUNCTION_TRIGGER;\\n\\n res.json({\\n message: 'Hello from Appwrite!',\\n payload,\\n secretKey,\\n randomNumber,\\n trigger,\\n });\\n}; Installing Dependencies Include a package.json file along with your function, and Appwrite handles the rest! The best practice is to make sure that the node_modules folder is not a part of your tarball. PHP json([\\n 'message' => 'Hello from Appwrite!',\\n 'payload' => $payload,\\n 'secretKey' => $secretKey,\\n 'randomNumber' => $randomNumber,\\n 'trigger' => $trigger,\\n ]);\\n}; Installing Dependencies Include a composer.json file along with your function, make sure to require autoload.php from vendor folder, and Appwrite handles the rest!. The best practice is to make sure that the vendor directory is not a part of your tarball. Python import random\\n\\ndef main(req, res):\\n payload = req.payload or 'No payload provided. Add custom data when executing function.'\\n\\n secretKey = req.variables.get(\\n 'SECRET_KEY',\\n 'SECRET_KEY variable not found. You can set it in Function settings.'\\n )\\n\\n randomNumber = random.random()\\n\\n trigger = req.variables['APPWRITE_FUNCTION_TRIGGER']\\n\\n return res.json({\\n 'message': 'Hello from Appwrite!',\\n 'payload': payload,\\n 'secretKey': secretKey,\\n 'randomNumber': randomNumber,\\n 'trigger': trigger,\\n }) Installing Dependencies Include a requirements.txt file with your function, Appwrite handles the rest! Ruby def main(req, res)\\n payload =\\n !req.payload.empty? ? req.payload :\\n 'No payload provided. Add custom data when executing function.'\\n\\n secretKey =\\n req.variables['SECRET_KEY'] ||\\n 'SECRET_KEY variable not found. You can set it in Function settings.'\\n\\n randomNumber = rand()\\n\\n trigger = req.variables['APPWRITE_FUNCTION_TRIGGER']\\n\\n return res.json({\\n :message => 'Hello from Appwrite!',\\n :payload => payload,\\n :secretKey => secretKey,\\n :randomNumber => randomNumber,\\n :trigger => trigger,\\n })\\nend Installing Dependencies Include a Gemfile with your function, Appwrite handles the rest! Deno export default async function (req: any, res: any) {\\n const payload =\\n req.payload ||\\n 'No payload provided. Add custom data when executing function.';\\n\\n const secretKey =\\n req.variables.SECRET_KEY ||\\n 'SECRET_KEY variable not found. You can set it in Function settings.';\\n\\n const randomNumber = Math.random();\\n\\n const trigger = req.variables.APPWRITE_FUNCTION_TRIGGER;\\n\\n res.json({\\n message: 'Hello from Appwrite!',\\n payload,\\n secretKey,\\n randomNumber,\\n trigger,\\n });\\n}; Installing Dependencies No special steps are required for Deno, Appwrite handles everything! Dart import 'dart:math';\\nimport 'dart:async';\\n\\nFuture start(final req, final res) async {\\n final payload =\\n !req.payload?.isEmpty ? req.payload :\\n 'No payload provided. Add custom data when executing function.';\\n\\n final secretKey =\\n req.variables['SECRET_KEY'] ??\\n 'SECRET_KEY variable not found. You can set it in Function settings.';\\n\\n final randomNumber = new Random().nextDouble();\\n\\n final trigger = req.variables['APPWRITE_FUNCTION_TRIGGER'];\\n\\n res.json({\\n 'message': 'Hello from Appwrite!',\\n 'payload': payload,\\n 'secretKey': secretKey,\\n 'randomNumber': randomNumber,\\n 'trigger': trigger,\\n });\\n} Installing Dependencies Include a pubspec.yaml file with your function- Appwrite handles the rest! Swift func main(req: RequestValue, res: RequestResponse) throws -> RequestResponse {\\n let payload = req.payload.isEmpty \\n ? \\\"No payload provided. Add custom data when executing function\\\" \\n : req.payload\\n \\n let secretKey = req.variables[\\\"SECRET_KEY\\\"] \\n ?? \\\"SECRET_KEY variable not found. You can set it in Function settings.\\\"\\n\\n let randomNumber = Double.random(in: 0...1)\\n\\n let trigger = req.variables[\\\"APPWRITE_FUNCTION_TRIGGER\\\"]\\n\\n return res.json(data: [\\n \\\"message\\\": \\\"Hello from Appwrite!\\\",\\n \\\"payload\\\": payload,\\n \\\"secretKey\\\": secretKey,\\n \\\"randomNumber\\\": randomNumber,\\n \\\"trigger\\\": trigger,\\n ])\\n} With Swift, your entrypoint can be empty since Appwrite automatically infers it from the location of your main() function. Just ensure that your cloud function has a single declaration of main() across your source files. Installing Dependencies Include a Package.swift file with your function, Appwrite handles the rest! .NET public async Task Main(RuntimeRequest req, RuntimeResponse res)\\n{\\n var payload = (string.IsNullOrEmpty(req.Payload))\\n ? \\\"No payload provided. Add custom data when executing function.\\\"\\n : req.Payload; \\n\\n var secretKey = req.Variables.ContainsKey(\\\"SECRET_KEY\\\")\\n ? req.Variables[\\\"SECRET_KEY\\\"]\\n : \\\"SECRET_KEY variable not found. You can set it in Function settings.\\\";\\n\\n var randomNumber = new Random().NextDouble();\\n\\n var trigger = req.Variables[\\\"APPWRITE_FUNCTION_TRIGGER\\\"];\\n\\n return res.Json(new() \\n {\\n { \\\"message\\\", \\\"Hello from Appwrite!\\\" },\\n { \\\"payload\\\", payload },\\n { \\\"secretKey\\\", secretKey },\\n { \\\"randomNumber\\\", randomNumber },\\n { \\\"trigger\\\", trigger },\\n });\\n} Installing Dependencies Include a Function.csproj file with your function, Appwrite handles the rest! Kotlin import kotlin.random.Random\\n\\n@Throws(Exception::class)\\nfun main(req: RuntimeRequest, res: RuntimeResponse): RuntimeResponse {\\n\\n val payload = if (req.payload.isEmpty()) \\\"No payload provided. Add custom data when executing function.\\\" else req.payload\\n\\n val secretKey = req.variables[\\\"SECRET_KEY\\\"] ?: \\\"SECRET_KEY variable not found. You can set it in Function settings.\\\"\\n \\n val randomNumber = Random.nextDouble(0.0, 1.0)\\n\\n val trigger = req.variables[\\\"APPWRITE_FUNCTION_TRIGGER\\\"] \\n\\n return res.json(mapOf(\\n \\\"message\\\" to \\\"Hello from Appwrite!\\\",\\n \\\"payload\\\" to payload,\\n \\\"secretKey\\\" to secretKey,\\n \\\"randomNumber\\\" to randomNumber,\\n \\\"trigger\\\" to trigger\\n ))\\n} Installing Dependencies Include a deps.gradle file with your function, Appwrite handles the rest! Java import java.util.Map;\\nimport java.util.HashMap;\\n\\npublic RuntimeResponse main(RuntimeRequest req, RuntimeResponse res) throws Exception {\\n\\n String payload = (req.getPayload().isEmpty())\\n ? \\\"No payload provided. Add custom data when executing function.\\\"\\n : req.getPayload();\\n\\n Map variables = req.getVariables();\\n\\n String secretKey = variables.containsKey(\\\"SECRET_KEY\\\")\\n ? variables.get(\\\"SECRET_KEY\\\")\\n : \\\"SECRET_KEY variable not found. You can set it in Function settings.\\\";\\n\\n double randomNumber = Math.random();\\n\\n String trigger = variables.get(\\\"APPWRITE_FUNCTION_TRIGGER\\\");\\n\\n Map response = new HashMap();\\n response.put(\\\"message\\\", \\\"Hello from Appwrite!\\\");\\n response.put(\\\"payload\\\", payload);\\n response.put(\\\"secretKey\\\", secretKey);\\n response.put(\\\"randomNumber\\\", randomNumber);\\n response.put(\\\"trigger\\\", trigger);\\n\\n return res.json(response);\\n} Installing Dependencies Include a deps.gradle file with your function, Appwrite handles the rest! C++ #include \\n#include \\n\\nstatic RuntimeResponse &main(const RuntimeRequest &req, RuntimeResponse &res) {\\n\\n std::string payload = req.payload.empty() ? \\n \\\"No payload provided. Add custom data when executing function.\\\" : \\n req.payload;\\n\\n std::string secretKey = req.variables.get(\\\"SECRET_KEY\\\", \\\"SECRET_KEY variable not found. You can set it in Function settings.\\\").asString();\\n\\n double randomNumber = ((double) rand() / (RAND_MAX));\\n\\n std::string trigger = req.variables[\\\"APPWRITE_FUNCTION_TRIGGER\\\"].asString();\\n\\n Json::Value response;\\n response[\\\"message\\\"] = \\\"Hello from Appwrite!\\\";\\n response[\\\"payload\\\"] = payload;\\n response[\\\"secretKey\\\"] = secretKey;\\n response[\\\"randomNumber\\\"] = randomNumber;\\n response[\\\"trigger\\\"] = trigger;\\n \\n return res.json(response);\\n} Installing Dependencies Include a CMakeLists.txt file with your function, Appwrite handles the rest! \", \"When your function is called, you receive two parameters, a request and a response object. The request object contains all data that was sent to the function including function variables. A schema of the request object can be found below and is the same for all runtimes.\", \" Property Description headers An object containing all the request headers. payload A JSON string containing the data when you created the execution. variables An object containing all the function variables. This includes variables automatically added by Appwrite. \", \"The response object has two functions, send() and json() that can be used to send data back to the client. The types and implementation of these functions vary depending on runtime due to all languages being slightly different. You can check out implementation in the specific languages to learn more about them. The schema of the response object can be found below: \", \" Function Description send(text, status) Function to return a text response. Status code defaults to 200 json(obj, status) Function to return a JSON response. Status code defaults to 200 \"]}, {\"level\": 2, \"title\": \"Create your Function\", \"body\": [\"Before you can deploy your function, you will need to create a new function from your Appwrite project's dashboard. Access the Function settings from your project's left navigation panel. Click the 'Add Function' button and choose a function name and runtime. In your Functions settings page, you can also set your function event triggers, CRON schedule, and set secure function variables for your function. \"]}, {\"level\": 2, \"title\": \"Deploy Your Function\", \"body\": [\"Once you've written your function, you can now deploy it using the Appwrite CLI, the Appwrite Server API or manually from the Appwrite console.\", \" Unix appwrite functions createDeployment \\\\\\n --functionId=6012cc93d5a7b \\\\\\n --activate=true \\\\\\n --entrypoint=\\\"index.js\\\" \\\\\\n --code=\\\".\\\" CMD appwrite functions createDeployment ^\\n --functionId=6012cc93d5a7b ^\\n --activate=true ^\\n --entrypoint=\\\"index.js\\\" ^\\n --code=\\\".\\\" PowerShell appwrite functions createDeployment `\\n --functionId=6012cc93d5a7b `\\n --activate=true `\\n --entrypoint=\\\"index.js\\\" `\\n --code=\\\".\\\" \", \"The command above accepts three parameters:\", \" Name Description functionId The ID of the Function you created in the previous step. You can find your function ID on your function page in your project dashboard. entrypoint The file name of your custom code that is executed when the function is triggered. code Path to your function tarball. When used with the Appwrite CLI, simply pass the path to your code directory, and the CLI will automatically package your code. \", \" You can also create new code deployments using the Appwrite server API\"]}, {\"level\": 3, \"title\": \"Manual Deployment\", \"body\": [\"You can also upload your functions to be deployed using the Appwrite console. The example below shows a simple Node.JS function, but the same idea applies to any other language.\", \" .\\n\\u251c\\u2500\\u2500 package.json\\n\\u2514\\u2500\\u2500 index.js\\n\", \"First, navigate inside the folder that contains your dependency file. Package your code files into the .tar.gz format with this tar command:\", \" Unix tar -czf code.tar.gz --exclude code.tar.gz . CMD tar -czf code.tar.gz --exclude code.tar.gz . PowerShell tar -czf code.tar.gz --exclude code.tar.gz . \", \"Next, navigate to your Appwrite console and upload the function.\", \" Navigate to the function you want to deploy. Click Create deployment. Select the Manual tab. Input the entry point of your function under Entrypoint. For the example above, it would be index.js. Upload code.tar.gz. Select Activate deployment after build to use your new function. Click Create to deploy your function.\"]}, {\"level\": 2, \"title\": \"Builds\", \"body\": [\"Deployments needs to be built before they can be activated. This is automatically done after creating a deployment and the time taken can vary depending on the runtime.\", \"If a build fails for any reason, the deployment's status is set to failed and you won't be able to activate it. You can however retry a build if you think it was caused by an external factor using the Retry Button on the Appwrite Dashboard or Retry Build endpoint with the buildId from the deployment.\", \"To find more details about a deployment and reasons for its failure, you can use the Get Deployment endpoint using the deploymentId.\", \"Deployments that have been built successfully are marked as ready and can be activated and executed.\", \" Build Times Compiled runtimes such as Rust and Swift take much longer to build however yield better performance over their interpreted counterparts such as Node.\"]}, {\"level\": 2, \"title\": \"Execute\", \"body\": [\"Besides setting a schedule or allowing your function to listen to Appwrite's system events, you can also manually execute your cloud functions from your Appwrite console or API.\", \" Function settings page. \", \"To execute a function from the Appwrite console, click the Execute Now button on your function's overview page. To execute a function from the API, send a POST request to the function execution endpoint.\", \"The function execution endpoint is available from both Appwrite client and server APIs. To execute your function from the server API, you need an API key with 'execution.write' scope.\", \"Executing the function from the client API requires the current user to have execution permission for the function. You can change the execution permission from the function's settings page in the Appwrite console, by default no user, team, or role has this permission.\", \" Web import { Client, Functions } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst functions = new Functions(client);\\n\\nlet promise = functions.createExecution('[FUNCTION_ID]');\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final functions = Functions(client);\\n\\n final execution = await functions.createExecution(\\n functionId: '[FUNCTION_ID]'\\n );\\n} Android import io.appwrite.Client\\nimport io.appwrite.services.Functions\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val functions = Functions(client)\\n\\n val execution = functions.createExecution(\\n functionId = \\\"[FUNCTION_ID]\\\"\\n )\\n} Apple import Appwrite\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let functions = Functions(client)\\n\\n let execution = try await functions.createExecution(\\n functionId: \\\"[FUNCTION_ID]\\\"\\n )\\n} GraphQL mutation {\\n functionsCreateExecution(functionId: \\\"[FUNCTION_ID]\\\") {\\n _id\\n statusCode\\n response\\n stdout\\n stderr\\n duration\\n }\\n} \"]}, {\"level\": 2, \"title\": \"Scheduled Execution\", \"body\": [\"Appwrite supports scheduled function executions. You can schedule executions using cron expressions in the settings of your function. Cron supports recurring executions as frequently as every minute.\", \"Here are some cron expressions for common intervals.\", \" Cron Expression Schedule */15 * * * * Every 15 minutes 0 * * * * Every Hour 0 0 * * * Every day at 00:00 0 0 * * 1 Every monday at 00:00 \"]}, {\"level\": 3, \"title\": \"Abuse and Limits\", \"body\": [\"Appwrite Functions can be executed using Client or Server SDKs. Client SDKs must be authenticated with an account that has been granted execution permissions on the function's settings page. Server SDKs require an API key with the correct scopes.\", \"The Functions Service APIs are rate limited to 60 calls per minute per account when using a Client SDK. Learn more about rate limiting. The response size of a Cloud Function is limited to 1MB. Responses larger than 1MB should be handled using Appwrite's Databases or Storage service.\", \"Each execution has a default timeout of 15 seconds to prevent hanging functions from blocking resources. This timeout can be configured per function on a function's settings page or in appwrite.json for up to 900 seconds.\"]}, {\"level\": 2, \"title\": \"Ignore Files\", \"body\": [\"Library folders such as node_modules or vendor should not be included in your tarball since these dependencies will be installed during your function's build process. Similarly, you should not include files containing secrets in your deployment. You can use the Appwite CLI's file ignoring feature to exclude specific files from a deployment.\", \"You can use the ignore property in your appwrite.json file to specify which files and folders should be ignored. This value must be an array of paths, as seen in the example below:\", \" {\\n ...\\n \\\"functions\\\": [\\n {\\n \\\"$id\\\": \\\"6213b58cb21dda6c3263\\\",\\n \\\"name\\\": \\\"My Awesome Function\\\",\\n \\\"runtime\\\": \\\"node-17.0\\\",\\n \\\"path\\\": \\\"My Awesome Function\\\",\\n \\\"entrypoint\\\": \\\"src/index.js\\\",\\n \\\"ignore\\\": [ \\\"node_modules\\\", \\\".env\\\" ]\\n },\\n ...\\n ],\\n}\", \"The example configuration above would not deploy the folder node_modules and the file .env.\", \"Alternatively, you can add a .gitignore file into your function folder and Appwrite CLI will ignore files specified in there. Keep in mind that if present, the ignore configuration in appwrite.json will nullify your ignore file.\", \"If you need to use a .gitignore file for your version control but don't want the Appwrite CLI to use it, you can specify the ignore key in appwrite.json to be an empty array.\"]}, {\"level\": 2, \"title\": \"Supported Runtimes\", \"body\": [\"Appwrite provides multiple code runtimes to execute your custom functions. Each runtime uses a Docker image tied to a specific language version to provide a safe, isolated playground to run your team's code.\", \"Below is a list of supported Cloud Functions runtimes. The Appwrite team continually adds support for new runtimes.\", \" Name Image Architectures node-14.5 openruntimes/node:v2-14.5 x86 / arm node-16.0 openruntimes/node:v2-16.0 x86 / arm node-18.0 openruntimes/node:v2-18.0 x86 / arm php-8.0 openruntimes/php:v2-8.0 x86 / arm php-8.1 openruntimes/php:v2-8.1 x86 / arm ruby-3.0 openruntimes/ruby:v2-3.0 x86 / arm ruby-3.1 openruntimes/ruby:v2-3.1 x86 / arm python-3.8 openruntimes/python:v2-3.8 x86 / arm python-3.9 openruntimes/python:v2-3.9 x86 / arm python-3.10 openruntimes/python:v2-3.10 x86 / arm deno-1.21 openruntimes/deno:v2-1.21 x86 deno-1.24 openruntimes/deno:v2-1.24 x86 dart-2.15 openruntimes/dart:v2-2.15 x86 / arm dart-2.16 openruntimes/dart:v2-2.16 x86 / arm dart-2.17 openruntimes/dart:v2-2.17 x86 / arm dotnet-3.1 openruntimes/dotnet:v2-3.1 x86 / arm dotnet-6.0 openruntimes/dotnet:v2-6.0 x86 / arm java-8.0 openruntimes/java:v2-8.0 x86 / arm java-11.0 openruntimes/java:v2-11.0 x86 / arm java-17.0 openruntimes/java:v2-17.0 x86 / arm java-18.0 openruntimes/java:v2-18.0 x86 / arm swift-5.5 openruntimes/swift:v2-5.5 x86 / arm kotlin-1.6 openruntimes/kotlin:v2-1.6 x86 / arm cpp-17.0 openruntimes/cpp:v2-17 x86 / arm \", \"By default, the following runtimes are enabled: node-16.0, php-8.0, python-3.9, ruby-3.0, and dart-2.17.\"]}, {\"level\": 2, \"title\": \"Function Variables\", \"body\": [\"Function variables supplied by Appwrite in addition to your own defined function variables that you can access from your function code. These variables give you information about your execution runtime environment.\", \" Name Description APPWRITE_FUNCTION_ID Your function's unique ID. APPWRITE_FUNCTION_NAME Your function's name. APPWRITE_FUNCTION_DEPLOYMENT Your function's code deployment unique ID. APPWRITE_FUNCTION_TRIGGER Either 'event' when triggered by one of the selected scopes, 'http' when triggered by an HTTP request or the Appwrite Console, or 'schedule' when triggered by the cron schedule. APPWRITE_FUNCTION_RUNTIME_NAME Your function runtime name. Can be any of Appwrite supported execution runtimes. APPWRITE_FUNCTION_RUNTIME_VERSION Your function runtime version. APPWRITE_FUNCTION_EVENT Your function event name. This value is available only when your function trigger is 'event.' This variable value can be any of Appwrite system events. APPWRITE_FUNCTION_EVENT_DATA Your function event payload. This value is available only when your function trigger is 'event'. This variable value contains a string in JSON format with your specific event data. APPWRITE_FUNCTION_DATA version >= 0.8.0 Your function's custom execution data. This variable's value contains a string in any format. If the custom data is in JSON FORMAT, it must be parsed inside the function code. Note that this variable can be set only when triggering a function using the SDK or HTTP API and the Appwrite Dashboard. APPWRITE_FUNCTION_PROJECT_ID version >= 0.8.0 Your function's project ID. APPWRITE_FUNCTION_USER_ID version >= 0.8.0 The userId of the user that triggered your function's execution. Executions triggered in the Appwrite console will be prepended with \\\"admin-\\\". APPWRITE_FUNCTION_JWT version >= 0.8.0 A JSON Web Token generated for the user that executes your function. APPWRITE_FUNCTION_EVENT_PAYLOAD version < 0.8.0 (deprecated) Your function event payload. Deprecated in favor of APPWRITE_FUNCTION_EVENT_DATA in version 0.8.0. APPWRITE_FUNCTION_ENV_NAME version < 0.8.0 (deprecated) Your function environment name. Can be any of Appwrite supported execution environments. APPWRITE_FUNCTION_ENV_VERSION version < 0.8.0 (deprecated) Your function environment version. \", \" Using an Appwrite SDK in Your Function Appwrite Server SDKs require an API key, an endpoint, and a project ID for authentication. Appwrite passes in your project ID with the function variable APPWRITE_FUNCTION_PROJECT_ID, but not the endpoint and API key. If you need to use a Server SDK, you will need to add function variables for your endpoint and API key in the Settings tab of your function. If you are running a local Appwrite instance, you will need to pass in the machine's public IP instead of 'https://localhost/v1'. Localhost inside the function's runtime container is not the same as localhost of your machine.\"]}, {\"level\": 2, \"title\": \"Appwrite SDKs in Functions\", \"body\": [\"You can integrate Appwrite Functions with other Appwrite services by using the appropriate Server SDK for your runtime. You can find starter code for your function's runtime in the Appwrite Function Starter repository.\", \"To initialize a Server SDK in a function, you need to provide your Appwrite endpoint and an API key in the Variables tab of your Function. The ID of your Appwrite project is passed in automatically as APPWRITE_FUNCTION_PROJECT_ID.\"]}, {\"level\": 2, \"title\": \"Monitor & Debug\", \"body\": [\"You can monitor your function execution usage stats and logs from your Appwrite console. To access your functions usage stats and logs, click the Usage tab in your function dashboard.\", \"The usage screen in your console will allow you to track the number of execution and your function CPU usage time. You can also review a detailed log of your function execution history, including the function exit code, output log, and error log.\", \" Function usage and logs tracking. \"]}]", "metadata": {"source": "https://appwrite.io/docs/functions"}} \ No newline at end of file diff --git a/docs/8c2aabe0-f62c-11ed-8355-0242c0a89002.json b/docs/8c2aabe0-f62c-11ed-8355-0242c0a89002.json deleted file mode 100644 index 8a8edbc..0000000 --- a/docs/8c2aabe0-f62c-11ed-8355-0242c0a89002.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Authentication \", \"body\": [\" Appwrite provides authentication for many different use cases to fit the needs of developers. Appwrite manages authentication with a combination of accounts and sessions. Accounts can be created in many different ways, such as through an anonymous session, email and password, OAuth authentication, magic URLs, and more.\"]}, {\"level\": 2, \"title\": \"Account vs Users API\", \"body\": [\" The Account API operates in the scope of the currently logged-in account and is usually used in a frontend or mobile app. The Users API is used in backend integrations and uses an API key with access to all your project users.\", \" Some of the Account API methods are available from Server SDKs when you authenticate with a JWT. This allows your Server SDK to perform actions on behalf of a user.\"]}, {\"level\": 2, \"title\": \"Create An Account\", \"body\": [\" A user account in Appwrite is the primary way to access information for a given project. Accounts can be created in many different ways, including email & password, anonymous sessions, OAuth2, phone authentication, and more. Applications can create and manage sessions through the REST API or Client SDKs.\"]}, {\"level\": 3, \"title\": \"Email\", \"body\": [\" Creating an account via email and password is one of the most common ways to sign up for an application. Appwrite provides email and password authentication out of the box. Using one of Appwrite's Client SDKs, or the REST APIs directly, you can create an account using an email address and password in your application.\", \" Passwords are hashed with Argon2, a resilient and secure password hashing algorithm.\", \" The example below shows you how to create an account:\", \" Web import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.create(\\n ID.unique(),\\n 'team@appwrite.io',\\n 'password'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.create(\\n userId: ID.unique(),\\n email: 'team@appwrite.io',\\n password: 'password',\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.create(\\n userId = ID.unique(),\\n email = \\\"team@appwrite.io\\\",\\n password = \\\"password\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet user = try await account.create(\\n userId: ID.unique(),\\n email: \\\"team@appwrite.io\\\",\\n password: \\\"password\\\"\\n) GraphQL \\nmutation {\\n accountCreate(userId: \\\"unique()\\\", email: \\\"team@appwrite.io\\\", password: \\\"password\\\") {\\n _id\\n email\\n name\\n }\\n} \", \" After an account is created, it can be verified through the account verification route provided by the Appwrite Accounts API. The user doesn't need to be verified to log in, but you can restrict resource access to verified users only using permissions.\"]}, {\"level\": 3, \"title\": \"Anonymous User\", \"body\": [\"Anonymous authentication allows users of your application to create a temporary valid session without creating an account. The session has an expiration time of one year. If an account is created while an anonymous session is active, it will be attached to the existing anonymous session.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createAnonymousSession();\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.createAnonymousSession(); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.createAnonymousSession() Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet user = try await account.createAnonymousSession() GraphQL \\nmutation {\\n accountCreateAnonymousSession {\\n _id\\n userId\\n provider\\n expire\\n }\\n} \"]}, {\"level\": 3, \"title\": \"OAuth\", \"body\": [\" OAuth is another way to authenticate a user using a multistep process. When using OAuth to authenticate, the authentication request is initiated from the client application. The user is then redirected to an OAuth2 provider to complete the authentication step, and finally, the user is redirected back to the client application. This provides integration with many third-party services that provide their own OAuth integration as a more secure approach than providing a username/password directly.\", \" In applications with first-party redirects, using OAuth2 for authentication is preferred. \", \" The example below shows you how to authenticate with OAuth2 using Amazon's OAuth system.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client();\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\n// Go to OAuth provider login page\\naccount.createOAuth2Session('amazon'); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\n// Go to OAuth provider login page\\nawait account.createOAuth2Session(provider: 'amazon'); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\n// Go to OAuth provider login page\\naccount.createOAuth2Session(provider = \\\"amazon\\\") Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\n// Go to OAuth provider login page\\ntry await account.createOAuth2Session(provider: \\\"amazon\\\") GraphQL OAuth is not available through the GraphQL API. You can use the REST API or any Client SDK instead. \", \" If there is already an active anonymous session, the new session will be attached to it. If there are no active sessions, the server will attempt to look for an account with the same email address as the email received from the OAuth2 provider and attach the new session to the existing account. If no matching account is found - the server will create a new account.\"]}, {\"level\": 3, \"title\": \"Phone\", \"body\": [\" Phone authentication is done using a two-step authentication process. When using phone authentication, the authentication request is initiated from the client application and an SMS is sent to the user with a secret key for creating a session. \", \" The example below shows you how to initiate a phone authentication request.\", \" Web import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createPhoneSession(\\n ID.unique(),\\n '+16171234567'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n});\\n\\n Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal session = await account.createPhoneSession(\\n userId: ID.unique(),\\n phone: '+16171234567'\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval session = account.createPhoneSession(\\n userId = ID.unique(),\\n phone = \\\"+16171234567\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet session = try await account.createPhoneSession(\\n userId: ID.unique(),\\n phone: \\\"+16171234567\\\"\\n) GraphQL mutation {\\n accountCreatePhoneSession(userId: \\\"unique()\\\", phone: \\\"+16171234567\\\") {\\n _id\\n userId\\n secret\\n expire\\n }\\n} \", \" After initiation, the returned user ID and secret are used to confirm the user. The secret will be a 6-digit number in the SMS message sent to the user.\", \" Web import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.updatePhoneSession(\\n '[USER_ID]',\\n '[SECRET]'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal session = await account.updatePhoneSession(\\n userId: '[USER_ID]',\\n secret: '[SECRET]'\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval session = account.updatePhoneSession(\\n userId = \\\"[USER_ID]\\\",\\n secret = \\\"[SECRET]\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet session = try await account.updatePhoneSession(\\n userId: \\\"[USER_ID]\\\",\\n secret: \\\"[SECRET]\\\"\\n) GraphQL \\nmutation {\\n accountUpdatePhoneSession(userId: \\\"[USER_ID]\\\", secret: \\\"[SECRET]\\\") {\\n _id\\n userId\\n provider\\n expire\\n }\\n} \", \" After the secret is verified, a session will be created.\"]}, {\"level\": 3, \"title\": \"Magic URL\", \"body\": [\" Magic URL authentication allows a user to sign in without a password. Magic URL authentication sends the user an email with a secret key for creating a new session. If the provided email does not belong to an existing user, the provided user ID is used to create a new user. If the account already exists, the provided user ID is ignored \", \" Only redirect URLs to domains added as a platform on your Appwrite console will be accepted. URLs not added as a platform are rejected to protect against redirect attacks.\", \" Magic URL authentication can be initiated like this: \", \" Web import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createMagicURLSession(ID.unique(), 'email@example.com');\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.createMagicURLSession(\\n userId: ID.unique(),\\n email: 'email@example.com',\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.createMagicURLSession(\\n userId = ID.unique(),\\n email = \\\"email@example.com\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet user = try await account.createMagicURLSession(\\n userId: ID.unique(),\\n email: \\\"email@example.com\\\"\\n) GraphQL mutation {\\n accountCreateMagicURLSession(\\n userId: \\\"unique()\\\",\\n email: \\\"email@example.com\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n secret\\n expire\\n }\\n} \", \" After receiving your secret from an email, you can create a new Magic URL session like this:\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.updateMagicURLSession('[USER_ID]', '[SECRET]');\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.updateMagicURLSession(\\n userId: '[USER_ID]',\\n secret: '[SECRET]',\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.updateMagicURLSession(\\n userId = '[USER_ID]',\\n secret = '[SECRET]'\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet user = try await account.updateMagicURLSession(\\n userId: '[USER_ID]',\\n secret: \\\"[SECRET]\\\"\\n) GraphQL mutation {\\n accountUpdateMagicURLSession(\\n userId: \\\"[USER_ID]\\\",\\n secret: \\\"[SECRET]\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n expire\\n provider\\n }\\n} \"]}, {\"level\": 2, \"title\": \"Login\", \"body\": [\" Logging in with an email and password is one of the most common ways to login into an application. \", \" The example below shows you how to create a session:\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createEmailSession(\\n 'team@appwrite.io',\\n 'password'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal session = await account.createEmailSession(\\n email: 'team@appwrite.io',\\n password: 'password'\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval session = account.createEmailSession(\\n email = \\\"team@appwrite.io\\\",\\n password = \\\"password\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet session = try await account.createEmailSession(\\n email: \\\"team@appwrite.io\\\",\\n password: \\\"password\\\"\\n) GraphQL mutation {\\n accountCreateEmailSession(email: \\\"team@appwrite.io\\\", password: \\\"password\\\") {\\n _id\\n userId\\n provider\\n expire\\n }\\n} \", \" When a user tries to access restricted resources, you can check if they have a valid, active session. The Account Service provides a get() method that checks whether the current user session is active and returns the account information if successful.\", \" The example below shows you how to check whether there is an active session:\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.get();\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal session = await account.get(); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval session = account.get() Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet session = try await account.get() GraphQL query {\\n accountGet {\\n _id\\n email\\n name\\n status\\n }\\n} \", \" An authenticated session in Appwrite lasts for 1 year and is then automatically expired.\"]}, {\"level\": 3, \"title\": \"Password Recovery\", \"body\": [\" If a user forgets their password, they can initiate a password recovery flow to recover their password. The Create Password Recovery endpoint sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link, they are redirected back to the password reset URL with the secret key and email address values attached to the URL as query strings. \", \" Only redirect URLs to domains added as a platform on your Appwrite console will be accepted. URLs not added as a platform are rejected to protect against redirect attacks.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createPasswordRecovery('email@example.com', 'https://example.com');\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = account.createRecovery(\\n email: 'email@example.com',\\n url: 'https://example.com',\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval response = account.createRecovery(\\n email = \\\"email@example.com\\\",\\n url = \\\"https://example.com\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet token = try await account.createRecovery(\\n email: \\\"email@example.com\\\",\\n url: \\\"https://example.com\\\"\\n) GraphQL mutation {\\n accountCreateRecovery(\\n email: \\\"email@example.com\\\",\\n url: \\\"https://example.com\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n secret\\n expire\\n }\\n} \", \"After receiving a email with the secret attached to the redirect link, submit a request to the Create Password Recovery (confirmation) endpoint to complete the recovery flow. The verification link sent to the user's email address is valid for 1 hour.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password');\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.updateRecovery(\\n userId: '[USER_ID]',\\n secret: '[SECRET]',\\n password: 'password'\\n passwordAgain: 'password'\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval token = account.updateRecovery(\\n userId = \\\"[USER_ID]\\\",\\n secret = \\\"[SECRET]\\\",\\n password = \\\"password\\\",\\n passwordAgain = \\\"password\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet token = try await account.updateRecovery(\\n userId: \\\"[USER_ID]\\\",\\n secret: \\\"[SECRET]\\\",\\n password: \\\"password\\\",\\n passwordAgain: \\\"password\\\"\\n) GraphQL mutation {\\n accountUpdateRecovery(\\n userId: \\\"[USER_ID]\\\",\\n secret: \\\"[SECRET]\\\",\\n password: \\\"password\\\",\\n passwordAgain: \\\"password\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n secret\\n expire\\n }\\n} \"]}]", "metadata": {"source": "https://appwrite.io/docs/authentication"}} \ No newline at end of file diff --git a/docs/ee438ef6-1f0c-11ee-98fa-00155da08df7.json b/docs/ee438ef6-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 5c8157b..0000000 --- a/docs/ee438ef6-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Getting Started for Apple \", \"body\": [\"Appwrite is a development platform that provides a powerful API and management console to get your next project up and running quickly.\", \"Create your first project now and start building on Appwrite Cloud.\"]}, {\"level\": 2, \"title\": \"Add your Apple Platform\", \"body\": [\"To init your SDK and start interacting with Appwrite services, you need to add a new Apple platform to your project. To add a new platform, go to your Appwrite console, choose the project you created in the step before, and click the 'Add Platform' button. Only API requests initiated from platforms added to your Appwrite project will be accepted. This prevents unauthorized apps from accessing your Appwrite project.\", \"From the options, choose to add a new Apple platform, select the iOS, macOS, watchOS or tvOS tab and add your app name and bundle identifier, Your bundle identifier can be found at the top of the General tab in your project settings, or in your Info.plist file. By registering your new app platform, you are allowing your app to communicate with the Appwrite API.\"]}, {\"level\": 2, \"title\": \"Get Appwrite Apple SDK\", \"body\": []}, {\"level\": 3, \"title\": \"Using Xcode\", \"body\": [\" Select File > Add Packages Search for the Appwrite SDK with the URL https://github.com/appwrite/sdk-for-apple In the right panel, select your target project and add your desired version rules Select Add Package and wait for package resolution to complete Make sure the Appwrite package product is checked and select Add Package again\"]}, {\"level\": 3, \"title\": \"Using Swift Packages\", \"body\": [\"Add the following to your Package.swift file: \", \" dependencies: [\\n .package(\\n name: \\\"Appwrite\\\",\\n url: \\\"https://github.com/appwrite/sdk-for-swift\\\",\\n .exact(\\\"2.0.0\\\")\\n )\\n]')\", \"Then add the dependency to your target:\", \" targets: [\\n .target(\\n name: \\\"[YOUR_TARGET]\\\",\\n dependencies: [\\n \\\"Appwrite\\\"\\n ]\\n )\\n]\"]}, {\"level\": 3, \"title\": \"OAuth Callback\", \"body\": [\"In order to capture the Appwrite OAuth callback url, the following URL scheme needs to added to your `Info.plist`\", \" CFBundleURLTypes\\n\\n\\n CFBundleTypeRole\\n Editor\\n CFBundleURLName\\n io.appwrite\\n CFBundleURLSchemes\\n \\n appwrite-callback-[PROJECT_ID]\\n \\n\\n\\n\", \"If you're using UIKit, you'll also need to add a hook to your SceneDelegate.swift file to ensure cookies work correctly.\", \" \\nfunc scene(_ scene: UIScene, openURLContexts URLContexts: Set) {\\n guard let url = URLContexts.first?.url,\\n url.absoluteString.contains(\\\"appwrite-callback\\\") else {\\n return\\n }\\n WebAuthComponent.handleIncomingCookie(from: url)\\n}\\n\"]}, {\"level\": 2, \"title\": \"Init your SDK\", \"body\": [\"Initialize your SDK code with your project ID, which can be found in your project settings page.\", \" import Appwrite\\nimport AppwriteModels\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\", \"Before sending any API calls to your new Appwrite project, make sure your device or emulator has network access to your Appwrite project's hostname or IP address.\"]}, {\"level\": 2, \"title\": \"Make Your First Request\", \"body\": [\"After your SDK configuration is set, access any of the Appwrite services and choose any request to send. Complete documentation for any service method you would like to use can be found in your SDK documentation or in the API References section.\", \" // Register User\\nlet account = Account(client)\\n\\nlet user = try await account.create(\\n userId: ID.unique(),\\n email: \\\"email@example.com\\\",\\n password: \\\"password\\\"\\n)\"]}, {\"level\": 2, \"title\": \"Listen to Changes\", \"body\": [\"To listen to changes in realtime from Appwrite, subscribe to a variety of channels and receive updates within milliseconds. Full documentation for Realtime can be found here.\", \" // Subscribe to files channel\\nlet realtime = Realtime(client)\\n\\nlet subscription = realtime.subscribe(channels: [\\\"files\\\"]) { message in\\n if (message.events!.contains(\\\"buckets.*.files.*.create\\\")) {\\n // Log when a new file is uploaded\\n print(String(describing: message.payload))\\n }\\n}\", \"If you're using macOS, for realtime to function correctly you need to ensure you have both \\\"Outgoing Connections (Client)\\\" and \\\"Incoming Connections (Server)\\\" enabled in your App Sandbox settings in your project file.\"]}, {\"level\": 2, \"title\": \"Full Example\", \"body\": [\" import Appwrite\\nimport AppwriteModels\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\n// Register User\\nlet account = Account(client)\\n\\nlet user = try await account.create(\\n userId: ID.unique(),\\n email: \\\"email@example.com\\\",\\n password: \\\"password\\\"\\n)\\n\\n// Subscribe to files channel\\nlet realtime = Realtime(client)\\n\\nlet subscription = realtime.subscribe(channels: [\\\"files\\\"]) { message in\\n if (message.events!.contains(\\\"buckets.*.files.*.create\\\")) {\\n // Log when a new file is uploaded\\n print(String(describing: message.payload))\\n }\\n}\"]}]", "metadata": {"source": "https://appwrite.io/docs/getting-started-for-apple"}} \ No newline at end of file diff --git a/docs/ee4391c6-1f0c-11ee-98fa-00155da08df7.json b/docs/ee4391c6-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index f904335..0000000 --- a/docs/ee4391c6-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Getting Started for Android \", \"body\": [\"Appwrite is a development platform that provides a powerful API and management console to get your next project up and running quickly.\", \"Create your first project now and start building on Appwrite Cloud.\"]}, {\"level\": 2, \"title\": \"Add your Android Platform\", \"body\": [\"To init your SDK and start interacting with Appwrite services, you need to add a new Android platform to your project. To add a new platform, go to your Appwrite console, choose the project you created in the step before, and click the 'Add Platform' button. Only API requests initiated from platforms added to your Appwrite project will be accepted. This prevents unauthorized apps from accessing your Appwrite project.\", \"From the options, choose to add a new Android platform and add add your app name and package name, your package name is generally the applicationId in your app-level build.gradle file. By registering your new app platform, you are allowing your app to communicate with the Appwrite API.\"]}, {\"level\": 2, \"title\": \"Get Appwrite Android SDK\", \"body\": [\"First, add this to your root level build.gradle file: \", \" repositories {\\n mavenCentral()\\n}\", \"Then add this to your project's build.gradle file:\", \" implementation(\\\"io.appwrite:sdk-for-android:2.0.0\\\")\"]}, {\"level\": 3, \"title\": \"OAuth Callback\", \"body\": [\"In order to capture the Appwrite OAuth callback url, the following activity needs to be added inside the `` tag, along side the existing `` tags in your AndroidManifest.xml. Be sure to replace the [PROJECT_ID] string with your actual Appwrite project ID. You can find your Appwrite project ID in your project settings screen in your Appwrite console.\", \" \\n ...\\n \\n ...\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\"]}, {\"level\": 2, \"title\": \"Init your SDK\", \"body\": [\"Initialize your SDK code with your project ID, which can be found in your project settings page.\", \" import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\", \"Before sending any API calls to your new Appwrite project, make sure your Android device or emulator has network access to your Appwrite project's hostname or IP address.\"]}, {\"level\": 2, \"title\": \"Make Your First Request\", \"body\": [\"After your SDK configuration is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would like to use can be found in the SDK documentation or in the API References section.\", \" // Register User\\nval account = Account(client)\\n\\nval user = account.create(\\n userId = ID.unique(),\\n email = \\\"email@example.com\\\",\\n password = \\\"password\\\"\\n)\"]}, {\"level\": 2, \"title\": \"Listen to Changes\", \"body\": [\"To listen to changes in realtime from Appwrite, subscribe to a variety of channels and receive updates within milliseconds. Full documentation for Realtime can be found here.\", \" // Subscribe to files channel\\nval realtime = Realtime(client)\\n\\nval subscription = realtime.subscribe(\\\"files\\\") {\\n if (it.events.contains(\\\"buckets.*.files.*.create\\\")) {\\n // Log when a new file is uploaded\\n print(it.payload.toString());\\n }\\n})\\n\"]}, {\"level\": 2, \"title\": \"Full Example\", \"body\": [\" import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.create(\\n userId = ID.unique(),\\n email = \\\"email@example.com\\\",\\n password = \\\"password\\\"\\n)\\n\\n// Subscribe to files channel\\nval realtime = Realtime(client)\\n\\nval subscription = realtime.subscribe(\\\"files\\\") {\\n if (it.events.contains(\\\"buckets.*.files.*.create\\\")) {\\n // Log when a new file is uploaded\\n print(it.payload.toString());\\n }\\n}\"]}]", "metadata": {"source": "https://appwrite.io/docs/getting-started-for-android"}} \ No newline at end of file diff --git a/docs/ee439482-1f0c-11ee-98fa-00155da08df7.json b/docs/ee439482-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 7d25442..0000000 --- a/docs/ee439482-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Getting Started for Server \", \"body\": [\"Appwrite is a development platform that provides a powerful API and management console to get your next project up and running quickly.\", \"Create your first project now and start building on Appwrite Cloud.\"]}, {\"level\": 2, \"title\": \"Get the Appwrite SDK for Your Platform\", \"body\": [\"We provide libraries and SDKs for major programming languages and platforms so you don't have to write code for interacting with our HTTP APIs from scratch.\", \"Choose your desired SDK corresponding to your product development platform and import it using the given package manager. For the sake of this tutorial we use code examples using Appwrite SDKs for Node.js, PHP, Python, Ruby, Dart, and Deno, but the same can be applied to any of our server side SDKs.\", \" Node.js npm install node-appwrite --save PHP composer require 'appwrite/appwrite' Python pip install appwrite Ruby gem install appwrite Deno import * as sdk from \\\"https://deno.land/x/appwrite/mod.ts\\\"; Dart dart pub add dart_appwrite Kotlin Add maven repositories to your build.gradle(.kts) file repositories {\\n mavenCentral()\\n} Add Appwrite SDK under dependencies in your build.gradle(.kts) file dependencies {\\n implementation(\\\"io.appwrite:sdk-for-kotlin:2.0.0\\\")\\n} Swift Add the Appwrite Swift SDK package as a dependency dependencies: [\\n .package(\\n name: \\\"Appwrite\\\",\\n url: \\\"https://github.com/appwrite/sdk-for-swift.git\\\",\\n .exact(\\\"2.0.0\\\")\\n )\\n] Add the dependency product to your target dependencies: [\\n \\\"Appwrite\\\"\\n] \"]}, {\"level\": 2, \"title\": \"Create Your First Appwrite Project\", \"body\": [\"Go to your new Appwrite console and click the icon in the top navigation header or on the 'Create Project' button on your console homepage. Choose a name for your project and click create to get started.\"]}, {\"level\": 2, \"title\": \"Authentication\", \"body\": [\"The Appwrite server API provides you with two authentication methods. The first one uses an API key, and the second is using a JSON Web Token (JWT). Each method has different use cases, and you can use whichever fills your app needs.\"]}, {\"level\": 3, \"title\": \"API Key\", \"body\": [\"Using an API Key you can interact with the Appwrite server API as an admin. You'll be able to access all of your project resources as long as your key has the relevant access scopes attached. To get your first API key, go to your appwrite console, choose the project you created in the step before and click the 'API Keys' link.\", \"Inside your API keys screen, click the 'Add API Key' button, choose your key name, for example: 'Demo Key', and select the scopes your key are granted to use. After complete, you could copy your new API Key and use it to initialize your Appwrite server SDK. To learn about the different API scopes available to you, read more about Appwrite API Keys \", \" Node.js const { Client } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n PHP use Appwrite\\\\Client;\\n\\n$client = (new Client())\\n ->setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n ->setProject('[PROJECT_ID]') // Your project ID\\n ->setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n Python from appwrite.client import Client\\n\\nclient = Client()\\n\\nclient = (client\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_key('919c2db5d4...a2a3346ad2') # Your secret API key\\n)\\n Ruby require 'appwrite'\\n\\nclient = Appwrite::Client.new()\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_key('919c2db5d4...a2a3346ad2') # Your secret API key\\n Deno import { Client } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n Dart import 'package:dart_appwrite/dart_appwrite.dart';\\n\\nClient client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n Kotlin import io.appwrite.Client\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setKey(\\\"919c2db5d4...a2a3346ad2\\\") // Your secret API key\\n Swift import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setKey(\\\"919c2db5d4...a2a3346ad2\\\") // Your secret API key\\n \", \" API Key Authentication When using Server SDKs, you authenticate with API keys. API keys are not restricted by account-based permissions but have restrictions on the types of resources that can be accessed. This means API keys can access all resources of specified types, regardless of which account can access them. Learn more about API keys\"]}, {\"level\": 3, \"title\": \"JSON Web Token (JWT) \\u00a0version >= 0.8\", \"body\": [\"Using a JSON Web Token (JWT), you can interact with the Appwrite server API as a specific user. You'll be able to access only the relevant user resources and perform actions on his behalf.\", \"To create a JWT, you need to use the \\\"account->createJWT\\\" method using one of the Appwrite client SDKs. Before creating a token, you need to make sure your user is authenticated using the createSession method or log in with an OAuth provider.\", \" Web SDK const account = new Account(client);\\naccount.createJWT()\\n .then(function (response) {\\n console.log(response);\\n }, function (error) {\\n console.log(error);\\n }); Flutter SDK Account account = Account(client);\\n\\nResponse user = await account.createJWT();\\n Android SDK val account = Account(client)\\n\\nval response = account.createJWT()\\n Apple SDK let account = Account(client)\\n\\nlet response = try await account.createJWT() \", \"After you get your valid token, you can pass it to your server and use it to initialize your Appwrite Server SDK and start making API calls. Your JWT is valid for a maximum time of 15 minutes or less if the user session has expired before that time.\", \" Node.js const { Client } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setJWT('919c2db5d4...a2a3346ad2'); // Your secret JWT\\n PHP use Appwrite\\\\Client;\\n\\n$client = (new Client())\\n ->setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n ->setProject('[PROJECT_ID]') // Your project ID\\n ->setJWT('919c2db5d4...a2a3346ad2'); // Your secret JWT\\n Python from appwrite.client import Client\\n\\nclient = Client()\\n\\nclient = (client\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_key('919c2db5d4...a2a3346ad2') # Your secret API key\\n)\\n Ruby require 'appwrite'\\n\\nclient = Client.new()\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_key('919c2db5d4...a2a3346ad2') # Your secret JWT\\n Deno import { Client } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setJWT('919c2db5d4...a2a3346ad2'); // Your secret JWT\\n Dart import 'package:dart_appwrite/dart_appwrite.dart';\\n\\nClient client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setJWT('919c2db5d4...a2a3346ad2'); // Your secret JWT\\n Kotlin import io.appwrite.Client\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setJWT(\\\"919c2db5d4...a2a3346ad2\\\") // Your secret JWT\\n Swift import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setJWT(\\\"919c2db5d4...a2a3346ad2\\\") // Your secret JWT\\n \"]}, {\"level\": 2, \"title\": \"Make Your First Request\", \"body\": [\"After your SDK configuration is set, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section.\", \" Node.js const { ID, Users } = require('node-appwrite');\\n\\nconst users = new Users(client);\\n\\nlet promise = users.create(\\n ID.unique(),\\n 'email@example.com',\\n null,\\n 'password'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); PHP use Appwrite\\\\ID;\\nuse Appwrite\\\\Services\\\\Users;\\n \\n$users = new Users($client);\\n\\n$user = $users->create(\\n userId: ID::unique(),\\n email: 'email@example.com',\\n phone: null,\\n password: 'password'\\n);\\n Python from appwrite.id import ID\\nfrom appwrite.services.users import Users\\n\\nusers = Users(client)\\n\\nuser = users.create(\\n user_id=ID.unique(),\\n email='email@example.com',\\n phone=None,\\n password='password'\\n) Ruby require 'appwrite'\\n\\nusers = Appwrite::Users.new(client)\\n\\nuser = users.create(\\n userId: ID.unique(),\\n email: 'email@example.com',\\n phone: nil,\\n password: 'password'\\n) Deno import { ID, Users } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n \\nconst users = new Users(client);\\n\\nlet promise = users.create(\\n ID.unique(),\\n 'email@example.com',\\n null,\\n 'password'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Dart import 'package:dart_appwrite/dart_appwrite.dart';\\n\\nfinal users = Users(client);\\n\\nfinal user = await users.create(\\n userId: ID.unique(),\\n email: 'email@example.com',\\n phone: null,\\n password: 'password'\\n); Kotlin import io.appwrite.ID\\nimport io.appwrite.services.Users\\n\\nval users = Users(client)\\n\\nval user = users.create(\\n userId = ID.unique(),\\n email = 'email@example.com',\\n phone = null,\\n password = 'password'\\n) Swift import Appwrite\\nimport AppwriteModels\\n \\nlet users = Users(client)\\n\\nlet user = try await users.create(\\n userId: ID.unique(),\\n email: \\\"email@example.com\\\",\\n phone: nil,\\n password: \\\"password\\\"\\n) \"]}, {\"level\": 2, \"title\": \"Full Example\", \"body\": [\" Node.js const { Client, ID, Users } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n\\nconst users = new Users(client);\\n\\nlet promise = users.create(\\n ID.unique(),\\n 'email@example.com',\\n null,\\n 'password'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); PHP use Appwrite\\\\Client;\\nuse Appwrite\\\\ID;\\nuse Appwrite\\\\Services\\\\Users;\\n\\n$client = (new Client())\\n ->setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n ->setProject('[PROJECT_ID]') // Your project ID\\n ->setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n\\n$users = new Users($client);\\n\\n$user = $users->create(\\n userId: ID::unique(),\\n email: 'email@example.com',\\n phone: null,\\n password: 'password'\\n); Python from appwrite.client import Client\\nfrom appwrite.id import ID\\nfrom appwrite.services.users import Users\\n\\nclient = Client()\\n\\nclient = (client\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_key('919c2db5d4...a2a3346ad2') # Your secret API key\\n)\\n\\nusers = Users(client)\\n\\nuser = users.create(\\n user_id=ID.unique(),\\n email='email@example.com',\\n phone=None,\\n password='password'\\n) Ruby require 'appwrite'\\n\\ninclude Appwrite\\n\\nclient = Client.new()\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_key('919c2db5d4...a2a3346ad2') # Your secret API key\\n\\nusers = Users.new(client)\\n\\nuser = users.create(\\n userId: ID.unique(),\\n email: 'email@example.com',\\n phone: nil,\\n password: 'password'\\n) Deno import { Client, ID, Users } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setKey('919c2db5d4...a2a3346ad2') // Your secret API key\\n\\nconst users = new Users(client);\\n\\nlet promise = users.create(\\n ID.unique(),\\n 'email@example.com',\\n null,\\n 'password'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Dart import 'package:dart_appwrite/dart_appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your Appwrite Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setKey('919c2db5d4...a2a3346ad2'); // Your secret API key\\n\\nfinal users = Users(client);\\n\\nfinal user = await users.create(\\n userId: ID.unique(),\\n email: 'email@example.com',\\n phone: null,\\n password: 'password'\\n); Kotlin import io.appwrite.Client\\nimport io.appwrite.ID\\nimport io.appwrite.services.Users\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setKey(\\\"919c2db5d4...a2a3346ad2\\\") // Your secret API key\\n\\nval users = Users(client)\\n\\nval user = users.create(\\n userId = ID.unique(),\\n email = 'email@example.com',\\n phone = null,\\n password = 'password'\\n) Swift import Appwrite\\nimport AppwriteModels\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your Appwrite Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setKey(\\\"919c2db5d4...a2a3346ad2\\\") // Your secret API key\\n\\nlet users = Users(client)\\n\\nlet user = try await users.create(\\n userId: ID.unique(),\\n email: \\\"email@example.com\\\",\\n phone: nil,\\n password: \\\"password\\\"\\n) \"]}]", "metadata": {"source": "https://appwrite.io/docs/getting-started-for-server"}} \ No newline at end of file diff --git a/docs/ee43ab70-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43ab70-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index a5a3ea6..0000000 --- a/docs/ee43ab70-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[]", "metadata": {"source": "https://appwrite.io/docs/client/account"}} \ No newline at end of file diff --git a/docs/ee43ad00-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43ad00-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 72bf55c..0000000 --- a/docs/ee43ad00-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[]", "metadata": {"source": "https://appwrite.io/docs/server/users"}} \ No newline at end of file diff --git a/docs/ee43ae68-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43ae68-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index a5475f1..0000000 --- a/docs/ee43ae68-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[]", "metadata": {"source": "https://appwrite.io/docs/client/teams"}} \ No newline at end of file diff --git a/docs/ee43b17e-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43b17e-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index e1bc8b5..0000000 --- a/docs/ee43b17e-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[]", "metadata": {"source": "https://appwrite.io/docs/client/databases"}} \ No newline at end of file diff --git a/docs/ee43b3c2-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43b3c2-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 6478d70..0000000 --- a/docs/ee43b3c2-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[]", "metadata": {"source": "https://appwrite.io/docs/client/storage"}} \ No newline at end of file diff --git a/docs/ee43b534-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43b534-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 6b02cc0..0000000 --- a/docs/ee43b534-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[]", "metadata": {"source": "https://appwrite.io/docs/client/functions"}} \ No newline at end of file diff --git a/docs/ee43b6f6-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43b6f6-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 9aadaf2..0000000 --- a/docs/ee43b6f6-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[]", "metadata": {"source": "https://appwrite.io/docs/client/locale"}} \ No newline at end of file diff --git a/docs/ee43b87c-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43b87c-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index e18a956..0000000 --- a/docs/ee43b87c-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[]", "metadata": {"source": "https://appwrite.io/docs/client/avatars"}} \ No newline at end of file diff --git a/docs/ee43b9ee-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43b9ee-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 0e5bf73..0000000 --- a/docs/ee43b9ee-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[]", "metadata": {"source": "https://appwrite.io/docs/server/health"}} \ No newline at end of file diff --git a/docs/ee43bb56-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43bb56-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index df823bc..0000000 --- a/docs/ee43bb56-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Databases \", \"body\": [\" The Databases Service allows you to store your application and users' data and fetch it using different supported queries. You can organize your data into a three-level hierarchy, which are databases, collections, and documents. Each database is a group of collections, each collection is a group of documents that share the same schema, and each document contains a set of data.\", \" In addition, the Databases Service provides built-in validation to check the integrity of your incoming data, custom indexing for query performance, relationships to link data, and a flexible permissions mechanism to easily segment data between different users, teams, and roles. You can also use the Appwrite Realtime API to subscribe to live changes in your database.\"]}, {\"level\": 2, \"title\": \"Create Your Databases\", \"body\": [\" Appwrite's Databases Service allows you to create multiple databases. Each database can contain many collections and can be backed by a different database adaptor in future versions.\", \" You can create your database by adding it to your Appwrite project's dashboard. Access the Databases Service settings from your project's left-hand navigation panel. To create a new database, click the Create Database button. Name your new database, and optionally provide a custom database ID.\", \" You can also create databases with the Appwrite CLI or the Appwrite Server SDKs.\"]}, {\"level\": 2, \"title\": \"Create Your Collections\", \"body\": [\" Appwrite uses collections as containers of documents. The terms collections and documents are used because the Appwrite JSON REST API resembles the API of a traditional NoSQL database. That said, internally, Appwrite will support both SQL and NoSQL database adapters like MariaDB, MySQL, or MongoDB. When working with an SQL adapter, Appwrite will treat your collections as tables and documents as rows on native SQL tables.\", \" To add a collection to a database, first navigate to the desired database's dashboard. In the database's dashboard, click the Add Collection button and choose your collection's name. For convenience, you can also set a custom ID for your collection instead of an auto-generated ID.\", \"You can manage your collections programmatically using the Appwrite CLI or one of Appwrite Server SDKs. You can manage documents with both the Server and Client SDKs.\"]}, {\"level\": 3, \"title\": \"Permissions\", \"body\": [\" Appwrite provides permissions to restrict access to documents at two levels, document and collection level. When a user has the appropriate type of access permissions granted at either the document or the collection level, they will be able to access or change the document. If the permission field is left empty, Client SDKs cannot access the document.\"]}, {\"level\": 4, \"title\": \"Document Level Permissions\", \"body\": [\"Document level permissions grant access to individual documents. Document level permissions are only applied if Document Security is enabled in the settings of your collection.\"]}, {\"level\": 4, \"title\": \"Collection Level Permissions\", \"body\": [\"Collection level permissions apply to every document in the collection.\"]}, {\"level\": 2, \"title\": \"Create Attributes\", \"body\": [\" Once you choose your permission model, navigate to your collection's Attributes tab. Attributes are used to define the structure of your documents and help the Appwrite API validate your users' input. Add your first attribute by clicking the Add Attribute button. You can choose between the following types:\", \" Attribute Description string String attribute. integer Integer attribute. float Float attribute. boolean Boolean attribute. enum Enum attribute. ip IP address attribute for IPv4 and IPv6. email Email address attribute. url URL attribute. relationship Relationship attribute relates one collection to another. Learn more about relationships. \", \" If an attribute must be populated in all documents, set it as required. If not, you may optionally set a default value. Additionally, decide if the attribute should be a single value or an array of values.\", \" When adding or removing attributes, your requests are processed in the background, indicated by the attribute's status. Depending on your collection's size and other factors, this could take anywhere from a few seconds to a few minutes to complete. You are able to create a document while your attributes are still being processed, however you are not able to use the attributes on the documents until they are available.\"]}, {\"level\": 3, \"title\": \"Create Documents\", \"body\": [\" Navigate to the Documents tab of your collection and click the Add Document button, or add a document programmatically:\", \" Web import { Client, Databases, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n\\nconst promise = databases.createDocument(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n ID.unique(),\\n {}\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final databases = Databases(client);\\n\\n try {\\n final document = databases.createDocument(\\n databaseId: '[DATABASE_ID]',\\n collectionId: '[COLLECTION_ID]',\\n documentId: ID.unique(),\\n data: {}\\n );\\n } on AppwriteException catch(e) {\\n print(e);\\n }\\n} Android import io.appwrite.Client\\nimport io.appwrite.services.Databases\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val databases = Databases(client)\\n\\n try {\\n val document = databases.createDocument(\\n databaseId = \\\"[DATABASE_ID]\\\",\\n collectionId = \\\"[COLLECTION_ID]\\\",\\n documentId = ID.unique(),\\n data = mapOf(\\\"a\\\" to \\\"b\\\"),\\n )\\n } catch (e: Exception) {\\n Log.e(\\\"Appwrite\\\", \\\"Error: \\\" + e.message)\\n }\\n} Apple import Appwrite\\nimport AppwriteModels\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let databases = Databases(client)\\n\\n do {\\n let document = try await databases.createDocument(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n documentId: ID.unique(),\\n data: [:]\\n )\\n } catch {\\n print(error.localizedDescription)\\n }\\n} GraphQL mutation {\\n databasesCreateDocument(\\n databaseId: \\\"[DATABASE_ID]\\\",\\n collectionId: \\\"[COLLECTION_ID]\\\",\\n documentId: \\\"[DOCUMENT_ID]\\\",\\n data: \\\"{}\\\"\\n ) {\\n _id\\n _collectionId\\n _databaseId\\n _createdAt\\n _updatedAt\\n _permissions\\n data\\n }\\n} \"]}, {\"level\": 2, \"title\": \"Indexes\", \"body\": [\" Databases use indexes to quickly locate data without having to search through every document for matches. To ensure the best performance, Appwrite recommends an index for every attribute queried. You can create an index by navigating to your collection's Indexes tab or by using your favorite Server SDK. If you plan to query multiple attributes in a single query, creating an index with all queried attributes will yield optimal performance.\", \" The following indexes are currently supported:\", \" Type Description key Plain Index to allow queries. unique Unique Index to disallow duplicates. fulltext For searching within string attributes. Required for the search query method. \"]}]", "metadata": {"source": "https://appwrite.io/docs/databases"}} \ No newline at end of file diff --git a/docs/ee43c218-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43c218-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index e7c9b5d..0000000 --- a/docs/ee43c218-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Relationships (Beta) \", \"body\": [\"Relationships describe how documents in different collections are associated, so that related documents can be read, updated, or deleted together. Entities in real-life often associate with each other in an organic and logical way, like a person and their dog, an album and its songs, or friends in a social network. These types of association between entities can be modeled in Appwrite using relationships.\", \" Beta Feature Appwrite Relationships is a beta feature. The API and behavior are subject to change in future versions.\"]}, {\"level\": 2, \"title\": \"When to Use a Relationship\", \"body\": [\"Relationships help reduce redundant information. For example, a user can create many posts in your app. You can model this without relationships by keeping a copy of the user's information in all the documents representing posts, but this creates a lot of duplicate information in your database about the user.\"]}, {\"level\": 3, \"title\": \"Benefits of Relationships\", \"body\": [\"Duplicated records waste storage, but more importantly, makes the database much harder to maintain. If the user changes their user name, you will have to update dozens or hundreds of records, a problem commonly known as an update anomaly in databases. You can avoid duplicate information by storing users and posts in separate collections and relating a user and their posts through a relationship.\"]}, {\"level\": 3, \"title\": \"Tradeoff\", \"body\": [\"Consider using relationships when the same information is found in multiple places to avoid duplicates. However, relationships come with the tradeoff of slowing down queries. For applications where the best read and write performance is important, it may be acceptable to tolerate duplicate data.\"]}, {\"level\": 2, \"title\": \"Configurable Options\", \"body\": []}, {\"level\": 3, \"title\": \"Directionality\", \"body\": [\"Appwrite relationships can be one-way or two-way.\", \" Type Description One-way The relationship is only visible to one side of the relation. This is similar to a tree data structure, where a tree has a reference to all of its leaves, but each leaf does not have a reference to its tree root. Two-way The relationship is visible to both sides of the relationship. This is similar to a graph data structure, where each node has references to all its edges, and all its edges can reference the nodes it connects. \"]}, {\"level\": 3, \"title\": \"Types\", \"body\": [\"Appwrite provides four different relationship types to enforce different associative rules between documents.\", \" Type Description One-to-one A document can only be related to one and only one document. If you try to relate multiple documents in a one-to-one relationship, Appwrite throws an error. For example, one user has one profile. One-to-many A document can be related to many other documents. For example, one user can create many posts. Many-to-one Many documents can be related to a single document. For example, many posts can share one author. Many-to-many A document can be related to many other documents. For example, a user can have many friends, and many users can share the same friend. \"]}, {\"level\": 3, \"title\": \"On-Delete Behavior\", \"body\": [\" Appwrite also allows you to define the behavior of a relationship when a document is deleted.\", \" Type Description Restrict If a document has at least one related document, it cannot be deleted. Cascade If a document has related documents, when it is deleted, the related documents are also deleted. Set null If a document has related documents, when it is deleted, the related documents are kept with their relationship attribute set to null. \"]}, {\"level\": 2, \"title\": \"Relationship Attributes\", \"body\": [\"Relationships are represented in a collection using relationship attributes. The relationship attribute contains the ID of related documents, which it references during read, update, and delete operations. This attribute is null if a document has no related documents.\"]}, {\"level\": 2, \"title\": \"Creating Relationships in the Appwrite Console\", \"body\": [\"You can create relationships in the Appwrite Console by adding a relationship attribute to a collection.\", \" In your project, navigate to Databases > Select your database > Select your collection > Attributes > Create attribute. Select Relationship as the attribute type. In the Relationship modal, select the relationship type and pick the related collection and attributes. Pick relationship attribute key(s) to represent the related collection. Relationship attribute keys are used to reference the related collection in queries, so pick something that's intuitive and easy to remember. Select desired on delete behavior. Click the Create button to create the relationship.\"]}, {\"level\": 2, \"title\": \"Creating Relationships Programmatically\", \"body\": [\" Node.js const { Client, Databases } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\ndatabases.createRelationshipAttribute(\\n 'marvel', // Database ID\\n 'movies', // Collection ID\\n 'reviews', // Related collection ID\\n 'oneToMany', // Relationship type\\n true, // Is two-way\\n 'reviews', // Attribute key \\n 'movie', // Two-way attribute key\\n 'cascade' // On delete action\\n); PHP use \\\\Appwrite\\\\Client;\\nuse \\\\Appwrite\\\\Services\\\\Databases;\\n\\n$client = (new Client())\\n ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n ->setProject('[PROJECT_ID]'); // Your project ID\\n\\n$databases = new Databases($client);\\n\\n$databases->createRelationshipAttribute(\\n databaseId: 'marvel', // Database ID\\n collectionId: 'movies', // Collection ID\\n relatedCollectionId: 'reviews', // Related collection ID\\n type: 'oneToMany', // Relationship type\\n twoWay: true, // Is two-way\\n key: 'reviews', // Attribute key \\n twoWayKey: 'movie', // Two-way attribute key\\n onDelete: 'cascade' // On delete action\\n); Python from appwrite.client import Client\\nfrom appwrite.services.databases import Databases\\n\\nclient = (Client()\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]')) # Your project ID\\n\\ndatabases = Databases(client)\\n\\ndatabases.create_relationship_attribute(\\n database_id='marvel', # Database ID \\n collection_id='movies', # Collection ID\\n related_collection_id='reviews', # Related collection ID \\n type='oneToMany', # Relationship type\\n two_way=True, # Is two-way\\n key='reviews', # Attribute key \\n two_way_key='movie', # Two-way attribute key\\n on_delete='cascade' # On delete action\\n) Ruby require 'appwrite'\\n\\ninclude Appwrite\\n\\nclient = Client.new\\n .set_endpoint('https://cloud.appwrite.io/v1')# Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n\\ndatabases = Databases.new(client)\\n\\ndatabases.create_relationship_attribute(\\n database_id: 'marvel', # Database ID \\n collection_id: 'movies', # Collection ID \\n related_collection_id: 'reviews', # Related collection ID \\n type: 'oneToMany', # Relationship type\\n two_way: true, # Is two-way\\n key: 'reviews', # Attribute key \\n two_way_key: 'movie', # Two-way attribute key \\n on_delete: 'cascade' # On delete action\\n) Deno import { Client, Databases } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n\\nconst client = new Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\"); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\ndatabases.createRelationshipAttribute(\\n \\\"marvel\\\", // Database ID \\n \\\"movies\\\", // Collection ID \\n \\\"reviews\\\", // Related collection ID \\n \\\"oneToMany\\\", // Relationship type \\n true, // Is two-way \\n \\\"reviews\\\", // Attribute key \\n \\\"movie\\\", // Two-way attribute key \\n \\\"cascade\\\" // On delete action \\n); Dart import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal databases = Databases(client);\\n\\nawait databases.createRelationshipAttribute(\\n databaseId: 'marvel', // Database ID \\n collectionId: 'movies', // Collection ID \\n relatedCollectionId: 'reviews', // Related collection ID \\n type: 'oneToMany', // Relationship type \\n twoWay: true, // Is two-way \\n key: 'reviews', // Attribute key \\n twoWayKey: 'movie', // Two-way attribute key \\n onDelete: 'cascade', // On delete action \\n); Kotlin import io.appwrite.Client\\nimport io.appwrite.services.Databases\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval databases = Databases(client)\\n\\ndatabases.createRelationshipAttribute(\\n databaseId = \\\"marvel\\\", // Database ID \\n collectionId = \\\"movies\\\", // Collection ID \\n relatedCollectionId = \\\"reviews\\\", // Related collection ID \\n type = \\\"oneToMany\\\", // Relationship type \\n twoWay = true, // Is two-way \\n key = \\\"reviews\\\", // Attribute key \\n twoWayKey = \\\"movie\\\", // Two-way attribute key \\n onDelete = \\\"cascade\\\" // On delete action \\n) Swift import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet databases = Databases(client)\\n\\ndatabases.createRelationshipAttribute(\\n databaseId: \\\"marvel\\\", // Database ID \\n collectionId: \\\"movies\\\", // Collection ID \\n relatedCollectionId: \\\"reviews\\\", // Related collection ID \\n type: \\\"oneToMany\\\", // Relationship type \\n twoWay: true, // Is two-way \\n key: \\\"reviews\\\", // Attribute key \\n twoWayKey: \\\"movie\\\", // Two-way attribute key \\n onDelete: \\\"cascade\\\" // On delete action \\n) \", \"The above example adds a relationship between the collections movies and reviews. A relationship attribute with the key reviews is added to the movies collection and another relationship attribute with the key movie is added to the reviews collection.\"]}, {\"level\": 2, \"title\": \"Creating Documents\", \"body\": [\"If a collection has relationship attributes, you can create documents in two ways.\"]}, {\"level\": 3, \"title\": \"Creating Child Documents\", \"body\": [\"You can create both the parent and child at once in a relationship by nesting data.\", \" Web const { Client, Databases, ID } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\nawait databases.createDocument(\\n 'marvel',\\n 'movies',\\n ID.unique(),\\n {\\n title: 'Spiderman',\\n year: 2002,\\n reviews: [\\n { author: 'Bob', text: 'Great movie!' },\\n { author: 'Alice', text: 'Loved it!' }\\n ]\\n }\\n) Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal databases = Databases(client);\\n\\nawait databases.createDocument(\\n databaseId: 'marvel',\\n collectionId: 'movies',\\n documentId: ID.unique(),\\n data: {\\n 'title': 'Spiderman',\\n 'year': 2002,\\n 'reviews': [\\n { 'author': 'Bob', 'text': 'Great movie!' },\\n { 'author': 'Alice', 'text': 'Loved it!' }\\n ]\\n },\\n); Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet databases = Database(client: client)\\n\\ndatabases.createDocument(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n documentId: ID.unique(),\\n data: [\\n \\\"title\\\": \\\"Spiderman\\\",\\n \\\"year\\\": 2002,\\n \\\"reviews\\\": [\\n [ \\\"author\\\": \\\"Bob\\\", \\\"text\\\": \\\"Great movie!\\\" ],\\n [ \\\"author\\\": \\\"Alice\\\", \\\"text\\\": \\\"Loved it!\\\" ]\\n ]\\n ]\\n) Android import io.appwrite.Client\\nimport io.appwrite.services.Database\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval databases = Database(client)\\n\\ndatabases.createDocument(\\n databaseId = \\\"marvel\\\",\\n collectionId = \\\"movies\\\",\\n documentId = ID.unique(),\\n data = mapOf(\\n \\\"title\\\" to \\\"Spiderman\\\",\\n \\\"year\\\" to 2002,\\n \\\"reviews\\\" to listOf(\\n mapOf(\\\"author\\\" to \\\"Bob\\\", \\\"text\\\" to \\\"Great movie!\\\"),\\n mapOf(\\\"author\\\" to \\\"Alice\\\", \\\"text\\\" to \\\"Loved it!\\\")\\n )\\n )\\n) \", \"If a nested child document is included and no child document ID is provided, the child document will be given a unique ID.\", \"If a nested child document is included and no conflicting child document ID exists, the child document will be created.\", \"If a nested child document is included and the child document ID already exists, the child document will be updated.\"]}, {\"level\": 3, \"title\": \"Reference Child Documents\", \"body\": [\"If the child documents are already present in the related collection, you can create the parent and reference the child documents using their IDs.\", \" Web const { Client, Databases, ID } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\nawait databases.createDocument(\\n 'marvel',\\n 'movies',\\n ID.unique(),\\n {\\n title: 'Spiderman',\\n year: 2002,\\n reviews: [\\n 'review1',\\n 'review2'\\n ]\\n }\\n) Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint \\n .setProject('[PROJECT_ID]'); // Your project ID \\n\\nfinal databases = Databases(client);\\n\\nawait databases.createDocument(\\n databaseId: 'marvel',\\n collectionId: 'movies',\\n documentId: ID.unique(),\\n data: {\\n 'title': 'Spiderman',\\n 'year': 2002,\\n 'reviews': [\\n 'review1',\\n 'review2'\\n ]\\n },\\n); Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint \\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID \\n\\nlet databases = Database(client: client)\\n\\ndatabases.createDocument(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n documentId: ID.unique(),\\n data: [\\n \\\"title\\\": \\\"Spiderman\\\",\\n \\\"year\\\": 2002,\\n \\\"reviews\\\": [\\n \\\"review1\\\",\\n \\\"review2\\\"\\n ]\\n ]\\n) Android import io.appwrite.Client\\nimport io.appwrite.services.Database\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint \\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID \\n\\nval databases = Database(client)\\n\\ndatabases.createDocument(\\n databaseId = \\\"marvel\\\",\\n collectionId = \\\"movies\\\",\\n documentId = ID.unique(),\\n data = mapOf(\\n \\\"title\\\" to \\\"Spiderman\\\",\\n \\\"year\\\" to 2002,\\n \\\"reviews\\\" to listOf(\\n \\\"review1\\\",\\n \\\"review2\\\"\\n )\\n )\\n) \"]}, {\"level\": 2, \"title\": \"Querying\", \"body\": [\"Querying is currently not available in the beta version of Appwrite Relationships but will be added in a later version.\"]}, {\"level\": 2, \"title\": \"Updating Relationships\", \"body\": [\"Relationships can be updated by updating the relationship attribute.\", \" Web const { Client, Databases } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\nawait databases.updateDocument(\\n 'marvel',\\n 'movies',\\n 'spiderman',\\n {\\n title: 'Spiderman',\\n year: 2002,\\n reviews: [\\n 'review4',\\n 'review5'\\n ]\\n }\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal databases = Databases(client);\\n\\nawait databases.updateDocument(\\n databaseId: 'marvel',\\n collectionId: 'movies',\\n documentId: 'spiderman',\\n data: {\\n 'title': 'Spiderman',\\n 'year': 2002,\\n 'reviews': [\\n 'review4',\\n 'review5'\\n ]\\n },\\n); Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet databases = Database(client: client)\\n\\ndatabases.updateDocument(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n documentId: \\\"spiderman\\\",\\n data: [\\n \\\"title\\\": \\\"Spiderman\\\",\\n \\\"year\\\": 2002,\\n \\\"reviews\\\": [\\n \\\"review4\\\",\\n \\\"review5\\\"\\n ]\\n ]\\n) Android import io.appwrite.Client\\nimport io.appwrite.services.Database\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nval databases = Database(client)\\n\\ndatabases.updateDocument(\\n databaseId = \\\"marvel\\\",\\n collectionId = \\\"movies\\\",\\n documentId = \\\"spiderman\\\",\\n data = mapOf(\\n \\\"title\\\" to \\\"Spiderman\\\",\\n \\\"year\\\" to 2002,\\n \\\"reviews\\\" to listOf(\\n \\\"review4\\\",\\n \\\"review5\\\"\\n )\\n )\\n) \"]}, {\"level\": 2, \"title\": \"Deleting Relationships\", \"body\": []}, {\"level\": 3, \"title\": \"Unlink Relationships, Retain Documents\", \"body\": [\"If you need to unlink documents in a relationship but retain the documents, you can do this by updating the relationship attribute and removing the ID of the related document.\", \"If a document can be related to only one document, you can delete the relationship by setting the relationship attribute to null.\", \"If a document can be related to more than one document, you can delete the relationship by setting the relationship attribute to an empty list.\"]}, {\"level\": 3, \"title\": \"Deleting Relationships and Documents\", \"body\": [\"If you need to delete the documents as well as unlink the relationship, the approach depends on the on-delete behavior of a relationship.\", \"If the on-delete behavior is restrict, the link between the documents needs to be deleted first before the documents can be deleted individually.\", \"If the on-delete behavior is set null, deleting a document will leave related documents in place with their relationship attribute set to null. If you wish to also delete related documents, they must be deleted individually.\", \"If the on-delete behavior is cascade, deleting the parent documents also deletes related child documents, except for many-to-one relationships. In many-to-one relationships, there are multiple parent documents related to a single child document, and when the child document is deleted, the parents are deleted in cascade.\", \" Web const { Client, Databases } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\nawait databases.deleteDocument(\\n 'marvel',\\n 'movies',\\n 'spiderman'\\n); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal databases = Databases(client);\\n\\nawait databases.deleteDocument(\\n databaseId: 'marvel',\\n collectionId: 'movies',\\n documentId: 'spiderman'\\n); Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet databases = Database(client: client)\\n\\ndatabases.deleteDocument(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n documentId: \\\"spiderman\\\"\\n) Android import io.appwrite.Client\\nimport io.appwrite.services.Database\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nval databases = Database(client)\\n\\ndatabases.deleteDocument(\\n databaseId = \\\"marvel\\\",\\n collectionId = \\\"movies\\\",\\n documentId = \\\"spiderman\\\"\\n) \"]}, {\"level\": 2, \"title\": \"Permissions\", \"body\": [\"To access documents in a relationship, you must have permission to access both the parent and child documents.\", \"When creating both the parent and child documents, the child document will inherit permissions from its parent.\", \"You can also provide explicit permissions to the child document if they should be different from their parent.\", \" Web const { Client, Databases, ID } = require('node-appwrite');\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst databases = new Databases(client);\\n\\nawait databases.createDocument(\\n 'marvel',\\n 'movies',\\n ID.unique(),\\n {\\n title: 'Spiderman',\\n year: 2002,\\n reviews: [\\n { \\n author: 'Bob', \\n text: 'Great movie!',\\n $permissions: [\\n Permission.read(Role.any())\\n ]\\n },\\n ]\\n }\\n) Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nfinal databases = Databases(client);\\n\\nawait databases.createDocument(\\n databaseId: 'marvel',\\n collectionId: 'movies',\\n documentId: ID.unique(),\\n data: {\\n 'title': 'Spiderman',\\n 'year': 2002,\\n 'reviews': [\\n { \\n 'author': 'Bob', \\n 'text:' 'Great movie!',\\n '\\\\$permissions': [\\n Permission.read(Role.any())\\n ]\\n },\\n ]\\n },\\n); Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet databases = Database(client: client)\\n\\ndatabases.createDocument(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n documentId: ID.unique(),\\n data: [\\n \\\"title\\\": \\\"Spiderman\\\",\\n \\\"year\\\": 2002,\\n \\\"reviews\\\": [\\n [ \\n \\\"author\\\": \\\"Bob\\\",\\n \\\"text\\\": \\\"Great movie!\\\",\\n \\\"$permissions\\\": [\\n Permission.read(Role.any())\\n ]\\n ],\\n ]\\n ]\\n) Android import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\nlet databases = Database(client: client)\\n\\ndatabases.createDocument(\\n databaseId: \\\"marvel\\\",\\n collectionId: \\\"movies\\\",\\n documentId: ID.unique(),\\n data: [\\n \\\"title\\\": \\\"Spiderman\\\",\\n \\\"year\\\": 2002,\\n \\\"reviews\\\": [\\n [ \\n \\\"author\\\": \\\"Bob\\\",\\n \\\"text\\\": \\\"Great movie!\\\",\\n \\\"$permissions\\\": [\\n Permission.read(Role.any())\\n ]\\n ],\\n ]\\n ]\\n) \", \"When creating, updating, or deleting in a relationship, you must have permission to access all documents referenced. If the user does not have read permission to any document, an exception will be thrown.\"]}]", "metadata": {"source": "https://appwrite.io/docs/databases-relationships"}} \ No newline at end of file diff --git a/docs/ee43c63c-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43c63c-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index e0d7528..0000000 --- a/docs/ee43c63c-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Storage \", \"body\": [\"Appwrite Storage allows you to manage files in your project. You can use it to store images, videos, documents, and other files for your projects. It provides APIs to upload, download, delete, and list files. Not only that Appwrite storage service provides APIs to manipulate images. Using the preview endpoint, you can crop, resize, rotate, add borders and border-radius and select the desired output format for your image. The preview API also allows you to change your image's quality, format, or compression, including WebP support for maximum optimization of your network bandwidth.\"]}, {\"level\": 2, \"title\": \"Buckets\", \"body\": [\"Storage buckets are similar to collections in the Databases service. The difference is buckets also provide more power to decide what kinds of files, what sizes you want to allow in that bucket, whether or not to encrypt the files, scan with antivirus, and more. Let's look at how we can create a bucket and configure it to your needs.\"]}, {\"level\": 3, \"title\": \"Create Bucket\", \"body\": [\"You can create your bucket from your Appwrite project's dashboard, using any of our server-side SDKs, or directly using our REST API authenticated using an API Key. To create a bucket from the Appwrite Console, access your Storage dashboard from your project's left navigation panel. Click Add Bucket button and choose your bucket's name. You can also set a custom ID for your bucket instead of an auto-generated ID for convenience. This will create a new bucket and take you to its settings page, where you can configure various options for your bucket.\", \"You can manage your buckets programmatically using one of Appwrite's Server SDKs or REST API paired with an API Key. You can manage files with both Server and Client side.\"]}, {\"level\": 4, \"title\": \"Permissions\", \"body\": [\"The Storage Service allows you to configure permissions at both the bucket level and the file level. When a user has the appropriate type of access permissions granted at either the bucket or the file level, they will be able to access the file. If the permission field is left empty, no one can access the file.\"]}, {\"level\": 5, \"title\": \"File Level Permissions\", \"body\": [\"File level permissions grant access to individual files. File level permissions are only enabled if File Security is enabled in the settings of your bucket.\"]}, {\"level\": 5, \"title\": \"Bucket Level Permissions\", \"body\": [\"Bucket level permissions apply to every file in the bucket.\"]}, {\"level\": 4, \"title\": \"More Bucket Configurations\", \"body\": [\"Storage buckets have many configuration options, including the type and maximum size of files in the bucket, whether encryption or anti-virus is enabled, and the compression algorithm to use. If you look at the bucket settings or the REST API example above, you can find these configurations. Let's look at what those are:\", \" Parameter Description allowedFileExtensions This parameter allows you to provide a list of file extensions that will be accepted into the bucket. maximumFileSize This parameter allows you to set the maximum size of a file that a bucket accepts. The buckets will accept any file less than or equal to the size provided here. encryption This parameter allows you to configure whether or not the files inside the bucket will be encrypted. We don't encrypt files bigger than 20MB. antivirus This parameter allows you to configure whether or not the files being added inside the bucket be scanned by antivirus. We don't scan files bigger than 20MB. \", \"You can learn more about storage buckets and APIs you can use to manage storage buckets from our Storage documentation. Now that we know how to create and configure buckets for our applications, let's look at how to manage files using the storage service.\"]}, {\"level\": 2, \"title\": \"Create File\", \"body\": [\"After you create a bucket or have navigated to bucket details, you can access the Files tab so you can upload, view, delete and update files in the bucket using the Appwrite project's dashboard. You can also perform all those operations from Appwrite's client SDK, server SDKs, and REST APIs as long as you have the proper permission.\", \"When you are in the Files tab, you can click Add File and select a file to upload. If the bucket is configured to accept the file type and size you are uploading, your file will be uploaded, and you will see the file in the list of files.\", \"You can also upload files programmatically using our SDKs:\", \" Web import { Client, Storage } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst storage = new Storage(client);\\n\\nconst promise = storage.createFile(\\n '[BUCKET_ID]',\\n ID.unique(),\\n document.getElementById('uploader').files[0]\\n);\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n});\\n Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() { // Init SDK\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final storage = Storage(client);\\n\\n final file = await storage.createFile(\\n bucketId: '[BUCKET_ID]',\\n fileId: ID.unique(),\\n file: InputFile.fromPath(path: './path-to-files/image.jpg', filename: 'image.jpg'),\\n );\\n} Android import io.appwrite.Client\\nimport io.appwrite.services.Storage\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\n val storage = Storage(client)\\n\\n val file = storage.createFile(\\n bucketId = \\\"[BUCKET_ID]\\\",\\n fileId = ID.unique(),\\n file = File(\\\"./path-to-files/image.jpg\\\"),\\n )\\n} Apple import Appwrite\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let storage = Storage(client)\\n\\n let file = try await storage.createFile(\\n bucketId: \\\"[BUCKET_ID]\\\",\\n fileId: ID.unique(),\\n file: InputFile.fromBuffer(yourByteBuffer,\\n filename: \\\"image.jpg\\\",\\n mimeType: \\\"image/jpeg\\\"\\n )\\n )\\n} GraphQL POST /v1/storage/buckets/{bucketId}/files HTTP/1.1\\nContent-Type: multipart/form-data; boundary=\\\"cec8e8123c05ba25\\\"\\nContent-Length: *Length of your entity body in bytes*\\nX-Appwrite-Project: [PROJECT_ID]\\n\\n--cec8e8123c05ba25\\nContent-Disposition: form-data; name=\\\"operations\\\"\\n\\n{ \\\"query\\\": \\\"mutation CreateFile($bucketId: String!, $fileId: String!, $file: InputFile!) { storageCreateFile(bucketId: $bucketId, fileId: $fileId, file: $file) { id } }\\\", \\\"variables\\\": { \\\"bucketId\\\": \\\"[BUCKET_ID]\\\", \\\"fileId\\\": \\\"[FILE_ID]\\\", \\\"file\\\": null } }\\n--cec8e8123c05ba25\\nContent-Disposition: form-data; name=\\\"map\\\"\\n\\n{ \\\"0\\\": [\\\"variables.file\\\"] }\\n--cec8e8123c05ba25\\nContent-Disposition: form-data; name=\\\"0\\\"; filename=\\\"file.txt\\\"\\nContent-Type: text/plain\\n\\nFile content.\\n\\n--cec8e8123c05ba25-- \", \" When you are trying to upload any files above 5MB, you will need to upload them in chunks for better reliability and performance. If you're using an Appwrite SDK, this is handled automatically. If you're not using an SDK, you can learn more about file handling in the REST API docs.\"]}, {\"level\": 2, \"title\": \"File Input\", \"body\": [\" Every language and platform handles file inputs differently. This section documents the expected input type of each SDK. Where applicable, Appwrite provides a InputFile class to accept multiple file sources, like paths, buffers, streams, or plain text.\"]}, {\"level\": 3, \"title\": \"Client SDK\", \"body\": [\" Web The Appwrite Web SDK expects a File object for file creation. This is most commonly associated with DOM file inputs. For example, for the input tag , you would call create file like this: const promise = storage.createFile(\\n '[BUCKET_ID]',\\n ID.unique(),\\n document.getElementById('uploader').files[0]\\n); Flutter The Appwrite Flutter SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(path: [PATH], filename: [NAME], contentType: [MIME TYPE]) Used to upload files from a provided path, filename and contentType are optional. Used for Flutter apps on mobile and desktop. InputFile.fromBytes(bytes: [BYTE LIST], filename: [NAME], contentType: [MIME TYPE]) Used to upload files from a byte list, contentType is optional. Used for Flutter apps on web Android The Appwrite Android SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(path: String) Used to upload files from a provided path. InputFile.fromFile(file: File) Used to upload files from a File object. InputFile.fromBytes(bytes: ByteArray, filename: String, mimeType: String) Used to upload files from a ByteArray object. Specify the file MIME type using the mimeType param. Apple The Appwrite Apple SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(_ path: String) Used to upload files from a provided path. InputFile.fromData(_ data: Data, filename: String, mimeType: String) Used to upload files from a Data object. Specify the file MIME type using the mimeType param. InputFile.fromBuffer(_ buffer: ByteBuffer, filename: String, mimeType: String) Used to upload files from a NIO Buffer object. Specify the file MIME type using the mimeType param. \"]}, {\"level\": 3, \"title\": \"Server SDK\", \"body\": [\" Node.js The Appwrite NodeJS SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(filePath, filename) Used to upload files from a provided path. InputFile.fromBuffer(buffer, filename) Used to upload files from a Buffer object. InputFile.fromBlob(blob, filename) Used to upload files from a Blob object. InputFile.fromStream(stream, filename, size) Used to upload files from a Readable Stream object. InputFile.fromPlainText(content, filename) Used to upload files in plain text. Expects a string encoded in UTF-8. PHP The Appwrite PHP SDK expects an InputFile class for file inputs. Method Description InputFile.withPath(string $path, ?string $mimeType = null, ?string $filename = null) Used to upload files from a provided path. InputFile.withData(string $data, ?string $mimeType = null, ?string $filename = null) Used to upload files from a string. Python The Appwrite Python SDK expects an InputFile class for file inputs. Method Description InputFile.from_path(path) Used to upload files from a provided path. InputFile.from_bytes(bytes) Used to upload files from an array of bytes. Ruby The Appwrite Ruby SDK expects an InputFile class for file inputs. Method Description InputFile.from_path(path) Used to upload files from a provided path. InputFile.from_string(string) Used to upload files from a String. InputFile.from_bytes(bytes) Used to upload files from an array of bytes. Deno The Appwrite Deno SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(filePath, filename) Used to upload files from a provided path. InputFile.fromBuffer(buffer, filename) Used to upload files from a Uint8Array object. InputFile.fromPlainText(content, filename) Used to upload files in plain text. Expects a string encoded in UTF-8. Dart The Appwrite Dart SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(path: [PATH], filename: [NAME], contentType: [MIME TYPE]) Used to upload files from a provided path, filename and contentType are optional. InputFile.fromBytes(bytes: [BYTE LIST], filename: [NAME], contentType: [MIME TYPE]) Used to upload files from a byte list, contentType is optional. Kotlin The Appwrite Kotlin SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(path: String) Used to upload files from a provided path. InputFile.fromFile(file: File) Used to upload files from a File object. InputFile.fromBytes(bytes: ByteArray, filename: String, mimeType: String) Used to upload files from a ByteArray object. Specify the file MIME type using the mimeType param. Swift The Appwrite Swift SDK expects an InputFile class for file inputs. Method Description InputFile.fromPath(_ path: String) Used to upload files from a provided path. InputFile.fromData(_ data: Data, filename: String, mimeType: String) Used to upload files from a Data object. Specify the file MIME type using the mimeType param. InputFile.fromBuffer(_ buffer: ByteBuffer, filename: String, mimeType: String) Used to upload files from a NIO Buffer object. Specify the file MIME type using the mimeType param. \"]}, {\"level\": 2, \"title\": \"Image Manipulation\", \"body\": [\"Another great built-in feature of Appwrite is the image manipulation feature. With Appwrite Storage's preview endpoint you can manipulate resolution, add borders and the border-radius, add background-color, set the opacity for the image, and get the image in the appropriate output format.\", \"This enables a wide range of possibilities! You can manipulate images resolution to display appropriately on responsive websites. You can also adjust the image border, background color, and border-radius to match the theming of your application. The Appwrite Storage also allows you to change the format and compression of your images for network transfer optimization and to help you speed your application. You can do all that without caring about how the image was originally uploaded.\", \"Below you can find all the different parameters offered by the preview endpoint to manipulate the image.\", \" Parameter Description height Set the height of the output image in pixels, the image will be resized keeping the aspect ratio intact. Accepts integer between 0-4000 width Set the width of the output image in pixels, the image will be resized keeping the aspect ratio intact. Accepts integer between 0-4000 gravity The gravity while cropping the image providing either width, height or both. Accepts any of: center, top-left, top, top-right, left, right, bottom-left, bottom, bottom-right quality Set the quality of the output image. Accepts integer between 0-100, where 100 is the highest quality. borderWidth Set a border with given width in pixels to the output image. Accepts integer between 0-100 borderColor Set a border-color for the output image. Accepts any valid Hex color value without the leading #. borderRadius Set a border-radius in pixels. Accepts an integer between 0-4000. opacity Set opacity for the output image. Accepts a float value between 0-1, where 0 makes it transparent. Only works with output format supporting alpha channel like png. rotation Rotate the output image by a degree. Accepts an integer between -360 to 360. background Set a background-color. Accepts any valid Hex color value without the leading #. Only works with output format supporting alpha channel like png. output Set the output image format. If not provided, will use the original image's format. Supported formats are: jpg, jpeg, png, gif and webp \"]}]", "metadata": {"source": "https://appwrite.io/docs/storage"}} \ No newline at end of file diff --git a/docs/ee43c9fc-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43c9fc-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 58590ba..0000000 --- a/docs/ee43c9fc-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Authentication \", \"body\": [\" Appwrite provides authentication for many different use cases to fit the needs of developers. Appwrite manages authentication with a combination of accounts and sessions. Accounts can be created in many different ways, such as through an anonymous session, email and password, OAuth authentication, magic URLs, and more.\"]}, {\"level\": 2, \"title\": \"Account vs Users API\", \"body\": [\" The Account API operates in the scope of the currently logged-in account and is usually used in a frontend or mobile app. The Users API is used in backend integrations and uses an API key with access to all your project users.\", \" Some of the Account API methods are available from Server SDKs when you authenticate with a JWT. This allows your Server SDK to perform actions on behalf of a user.\"]}, {\"level\": 2, \"title\": \"Create An Account\", \"body\": [\" A user account in Appwrite is the primary way to access information for a given project. Accounts can be created in many different ways, including email & password, anonymous sessions, OAuth2, phone authentication, and more. Applications can create and manage sessions through the REST API or Client SDKs.\"]}, {\"level\": 3, \"title\": \"Email\", \"body\": [\" Creating an account via email and password is one of the most common ways to sign up for an application. Appwrite provides email and password authentication out of the box. Using one of Appwrite's Client SDKs, or the REST APIs directly, you can create an account using an email address and password in your application.\", \" Passwords are hashed with Argon2, a resilient and secure password hashing algorithm.\", \" The example below shows you how to create an account:\", \" Web import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.create(\\n ID.unique(),\\n 'team@appwrite.io',\\n 'password'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.create(\\n userId: ID.unique(),\\n email: 'team@appwrite.io',\\n password: 'password',\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.create(\\n userId = ID.unique(),\\n email = \\\"team@appwrite.io\\\",\\n password = \\\"password\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet user = try await account.create(\\n userId: ID.unique(),\\n email: \\\"team@appwrite.io\\\",\\n password: \\\"password\\\"\\n) GraphQL \\nmutation {\\n accountCreate(userId: \\\"unique()\\\", email: \\\"team@appwrite.io\\\", password: \\\"password\\\") {\\n _id\\n email\\n name\\n }\\n} \", \" After an account is created, it can be verified through the account verification route provided by the Appwrite Accounts API. The user doesn't need to be verified to log in, but you can restrict resource access to verified users only using permissions.\"]}, {\"level\": 3, \"title\": \"Anonymous User\", \"body\": [\"Anonymous authentication allows users of your application to create a temporary valid session without creating an account. The session has an expiration time of one year. If an account is created while an anonymous session is active, it will be attached to the existing anonymous session.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createAnonymousSession();\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.createAnonymousSession(); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.createAnonymousSession() Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet user = try await account.createAnonymousSession() GraphQL \\nmutation {\\n accountCreateAnonymousSession {\\n _id\\n userId\\n provider\\n expire\\n }\\n} \"]}, {\"level\": 3, \"title\": \"OAuth\", \"body\": [\" OAuth is another way to authenticate a user using a multistep process. When using OAuth to authenticate, the authentication request is initiated from the client application. The user is then redirected to an OAuth2 provider to complete the authentication step, and finally, the user is redirected back to the client application. This provides integration with many third-party services that provide their own OAuth integration as a more secure approach than providing a username/password directly.\", \" In applications with first-party redirects, using OAuth2 for authentication is preferred. \", \" The example below shows you how to authenticate with OAuth2 using Amazon's OAuth system.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\n// Go to OAuth provider login page\\naccount.createOAuth2Session('amazon'); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\n// Go to OAuth provider login page\\nawait account.createOAuth2Session(provider: 'amazon'); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\n// Go to OAuth provider login page\\naccount.createOAuth2Session(provider = \\\"amazon\\\") Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\n// Go to OAuth provider login page\\ntry await account.createOAuth2Session(provider: \\\"amazon\\\") GraphQL OAuth is not available through the GraphQL API. You can use the REST API or any Client SDK instead. \", \" If there is already an active anonymous session, the new session will be attached to it. If there are no active sessions, the server will attempt to look for an account with the same email address as the email received from the OAuth2 provider and attach the new session to the existing account. If no matching account is found - the server will create a new account.\"]}, {\"level\": 3, \"title\": \"Phone\", \"body\": [\" Phone authentication is done using a two-step authentication process. When using phone authentication, the authentication request is initiated from the client application and an SMS is sent to the user with a secret key for creating a session. \", \" The example below shows you how to initiate a phone authentication request.\", \" Web import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createPhoneSession(\\n ID.unique(),\\n '+16171234567'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n});\\n\\n Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal session = await account.createPhoneSession(\\n userId: ID.unique(),\\n phone: '+16171234567'\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval session = account.createPhoneSession(\\n userId = ID.unique(),\\n phone = \\\"+16171234567\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet session = try await account.createPhoneSession(\\n userId: ID.unique(),\\n phone: \\\"+16171234567\\\"\\n) GraphQL mutation {\\n accountCreatePhoneSession(userId: \\\"unique()\\\", phone: \\\"+16171234567\\\") {\\n _id\\n userId\\n secret\\n expire\\n }\\n} \", \" After initiation, the returned user ID and secret are used to confirm the user. The secret will be a 6-digit number in the SMS message sent to the user.\", \" Web import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.updatePhoneSession(\\n '[USER_ID]',\\n '[SECRET]'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal session = await account.updatePhoneSession(\\n userId: '[USER_ID]',\\n secret: '[SECRET]'\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\nimport io.appwrite.ID\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval session = account.updatePhoneSession(\\n userId = \\\"[USER_ID]\\\",\\n secret = \\\"[SECRET]\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet session = try await account.updatePhoneSession(\\n userId: \\\"[USER_ID]\\\",\\n secret: \\\"[SECRET]\\\"\\n) GraphQL \\nmutation {\\n accountUpdatePhoneSession(userId: \\\"[USER_ID]\\\", secret: \\\"[SECRET]\\\") {\\n _id\\n userId\\n provider\\n expire\\n }\\n} \", \" After the secret is verified, a session will be created.\"]}, {\"level\": 3, \"title\": \"Magic URL\", \"body\": [\" Magic URL authentication allows a user to sign in without a password. Magic URL authentication sends the user an email with a secret key for creating a new session. If the provided email does not belong to an existing user, the provided user ID is used to create a new user. If the account already exists, the provided user ID is ignored \", \" Only redirect URLs to domains added as a platform on your Appwrite console will be accepted. URLs not added as a platform are rejected to protect against redirect attacks.\", \" Magic URL authentication can be initiated like this: \", \" Web import { Client, Account, ID } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createMagicURLSession(ID.unique(), 'email@example.com');\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.createMagicURLSession(\\n userId: ID.unique(),\\n email: 'email@example.com',\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.createMagicURLSession(\\n userId = ID.unique(),\\n email = \\\"email@example.com\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet user = try await account.createMagicURLSession(\\n userId: ID.unique(),\\n email: \\\"email@example.com\\\"\\n) GraphQL mutation {\\n accountCreateMagicURLSession(\\n userId: \\\"unique()\\\",\\n email: \\\"email@example.com\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n secret\\n expire\\n }\\n} \", \" After receiving your secret from an email, you can create a new Magic URL session like this:\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.updateMagicURLSession('[USER_ID]', '[SECRET]');\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.updateMagicURLSession(\\n userId: '[USER_ID]',\\n secret: '[SECRET]',\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval user = account.updateMagicURLSession(\\n userId = '[USER_ID]',\\n secret = '[SECRET]'\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet user = try await account.updateMagicURLSession(\\n userId: '[USER_ID]',\\n secret: \\\"[SECRET]\\\"\\n) GraphQL mutation {\\n accountUpdateMagicURLSession(\\n userId: \\\"[USER_ID]\\\",\\n secret: \\\"[SECRET]\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n expire\\n provider\\n }\\n} \"]}, {\"level\": 2, \"title\": \"Login\", \"body\": [\" Logging in with an email and password is one of the most common ways to login into an application. \", \" The example below shows you how to create a session:\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createEmailSession(\\n 'team@appwrite.io',\\n 'password'\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal session = await account.createEmailSession(\\n email: 'team@appwrite.io',\\n password: 'password'\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval session = account.createEmailSession(\\n email = \\\"team@appwrite.io\\\",\\n password = \\\"password\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet session = try await account.createEmailSession(\\n email: \\\"team@appwrite.io\\\",\\n password: \\\"password\\\"\\n) GraphQL mutation {\\n accountCreateEmailSession(email: \\\"team@appwrite.io\\\", password: \\\"password\\\") {\\n _id\\n userId\\n provider\\n expire\\n }\\n} \", \" When a user tries to access restricted resources, you can check if they have a valid, active session. The Account Service provides a get() method that checks whether the current user session is active and returns the account information if successful.\", \" The example below shows you how to check whether there is an active session:\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.get();\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal session = await account.get(); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval session = account.get() Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet session = try await account.get() GraphQL query {\\n accountGet {\\n _id\\n email\\n name\\n status\\n }\\n} \", \" An authenticated session in Appwrite lasts for 1 year and is then automatically expired.\"]}, {\"level\": 3, \"title\": \"Password Recovery\", \"body\": [\" If a user forgets their password, they can initiate a password recovery flow to recover their password. The Create Password Recovery endpoint sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link, they are redirected back to the password reset URL with the secret key and email address values attached to the URL as query strings. \", \" Only redirect URLs to domains added as a platform on your Appwrite console will be accepted. URLs not added as a platform are rejected to protect against redirect attacks.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createPasswordRecovery('email@example.com', 'https://example.com');\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = account.createRecovery(\\n email: 'email@example.com',\\n url: 'https://example.com',\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval response = account.createRecovery(\\n email = \\\"email@example.com\\\",\\n url = \\\"https://example.com\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet token = try await account.createRecovery(\\n email: \\\"email@example.com\\\",\\n url: \\\"https://example.com\\\"\\n) GraphQL mutation {\\n accountCreateRecovery(\\n email: \\\"email@example.com\\\",\\n url: \\\"https://example.com\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n secret\\n expire\\n }\\n} \", \"After receiving a email with the secret attached to the redirect link, submit a request to the Create Password Recovery (confirmation) endpoint to complete the recovery flow. The verification link sent to the user's email address is valid for 1 hour.\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password');\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal user = await account.updateRecovery(\\n userId: '[USER_ID]',\\n secret: '[SECRET]',\\n password: 'password'\\n passwordAgain: 'password'\\n); Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval token = account.updateRecovery(\\n userId = \\\"[USER_ID]\\\",\\n secret = \\\"[SECRET]\\\",\\n password = \\\"password\\\",\\n passwordAgain = \\\"password\\\"\\n) Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet token = try await account.updateRecovery(\\n userId: \\\"[USER_ID]\\\",\\n secret: \\\"[SECRET]\\\",\\n password: \\\"password\\\",\\n passwordAgain: \\\"password\\\"\\n) GraphQL mutation {\\n accountUpdateRecovery(\\n userId: \\\"[USER_ID]\\\",\\n secret: \\\"[SECRET]\\\",\\n password: \\\"password\\\",\\n passwordAgain: \\\"password\\\"\\n ) {\\n _id\\n _createdAt\\n userId\\n secret\\n expire\\n }\\n} \"]}]", "metadata": {"source": "https://appwrite.io/docs/authentication"}} \ No newline at end of file diff --git a/docs/ee43ceca-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43ceca-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 10153aa..0000000 --- a/docs/ee43ceca-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Client to Server Auth \", \"body\": [\" You can extend Appwrite's APIs by building backend apps using Server SDKs. To secure your backend app's APIs, client apps must prove their identity against your backend app before accessing sensitive information. You can secure these APIs and enforce access permissions in your backend app by using JWT authentication.\", \" If you are already authenticated on your client-side app and need your backend app to act on behalf of the user, this guide will walk you through the process.\"]}, {\"level\": 2, \"title\": \"Proof of Identity\", \"body\": [\"Before making requests to your backend APIs, your client application needs to first create a session directly with Appwrite using the account service. This session will act like an ID card for the user and can be used to access resources in Appwrite. The client will only receive information accessible to the user based on the resources's permissions.\", \"When you build backend APIs to extend Appwrite's functionality, these APIs should still respect access permissions to keep user data secure. Appwrite's backend SDKs allows you to securely act on behalf of a user with the same permissions by using JWT authentication.\"]}, {\"level\": 2, \"title\": \"JWT Authentication\", \"body\": [\"JSON Web Tokens (JWTs) are a secure means to transfer information or claims between two parties. JWT act like temporary copies of the user's ID card that allow Appwrite's Server SDKs to access information oh behalf of a user.\", \"You need to create a session using the Client SDKs before generating a JWT. The JWT will be a stateless proof of claim for the identity of the authenticated user and expire after 15 minutes or when the session is deleted.\", \"You can generate a JWT like this:\", \" Web import { Client, Account } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nconst account = new Account(client);\\n\\nconst promise = account.createJWT();\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nfinal client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]'); // Your project ID\\n\\nfinal account = Account(client);\\n\\nfinal jwt = await account.createJWT();\\n\\n Android import io.appwrite.Client\\nimport io.appwrite.services.Account\\n\\nval client = Client(context)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nval account = Account(client)\\n\\nval jwt = account.createJWT() Apple import Appwrite\\n\\nlet client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n\\nlet account = Account(client)\\n\\nlet jwt = try await account.createJWT() GraphQL mutation {\\n accountCreateJWT {\\n jwt\\n }\\n} \", \"Your server application can use the JWT to act on behalf of the user by creating a Client instance with the JWT for each request it receives. To keep your API secure, discard the client object after each request.\", \" Node.js const { Client } = require('node-appwrite');\\n\\nconst client = new Client();\\n\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setJWT('eyJJ9.eyJ...886ca'); // Your secret JSON Web Token PHP use Appwrite\\\\Client;\\n\\n$client = new Client();\\n\\n$client\\n ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n ->setProject('[PROJECT_ID]') // Your project ID\\n ->setJWT('eyJJ9.eyJ...886ca'); // Your secret JSON Web Token Python from appwrite.client import Client\\n\\nclient = Client()\\n\\n(client\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_jwt('eyJJ9.eyJ...886ca') # Your secret JSON Web Token\\n) Ruby require 'appwrite'\\n\\ninclude Appwrite\\n\\nclient = Client.new\\n\\nclient\\n .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint\\n .set_project('[PROJECT_ID]') # Your project ID\\n .set_jwt('eyJJ9.eyJ...886ca') # Your secret JSON Web Token Deno import { Client } from \\\"https://deno.land/x/appwrite/mod.ts\\\";\\n\\nlet client = new Client();\\n\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setJWT('eyJJ9.eyJ...886ca'); // Your secret JSON Web Token Dart import 'package:dart_appwrite/dart_appwrite.dart';\\n\\nfinal client = Client();\\n\\nclient\\n .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint\\n .setProject('[PROJECT_ID]') // Your project ID\\n .setJWT('eyJJ9.eyJ...886ca'); // Your secret JSON Web Token Kotlin import io.appwrite.Client\\n\\nval client = Client()\\n\\nclient\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setJWT(\\\"eyJJ9.eyJ...886ca\\\") // Your secret JSON Web Token Swift import Appwrite\\n\\nlet client = Client()\\n\\nclient\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\") // Your API Endpoint\\n .setProject(\\\"[PROJECT_ID]\\\") // Your project ID\\n .setJWT(\\\"eyJJ9.eyJ...886ca\\\") // Your secret JSON Web Token \"]}, {\"level\": 2, \"title\": \"When Should I Use JWT Auth?\", \"body\": [\"JWT auth is useful when you need your backend app's Server SDK to be restricted by the same set of permissions.\", \"If your backend app's Server SDK is using an API key, it will fetch all resources regardless of permissions. This means the Server SDK might fetch files and documents your user should not be able to see, which is not helpful when you need to act on behalf of a user.\", \"If your backend app's Server SDK is using a JWT, it will only fetch resources your user has permissions to access.\"]}]", "metadata": {"source": "https://appwrite.io/docs/authentication-server"}} \ No newline at end of file diff --git a/docs/ee43d1f4-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43d1f4-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index cc4c1b5..0000000 --- a/docs/ee43d1f4-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Security \", \"body\": [\" Appwrite provides many security features to keep both your Appwrite project and your user's information secure.\"]}, {\"level\": 2, \"title\": \"Persistence\", \"body\": [\" Appwrite handles the persistence of the session in a consistent way across SDKs. After authenticating with an SDK, the SDK will persist the session so that the user will not need to log in again the next time they open the app. The mechanism for persistence depends on the SDK.\", \" Best Practice Only keep user sessions active as long as needed and only maintain one instance of the Client SDK in your app to avoid conflicting session data.\", \" SDK Persistence Method Web Uses a secure session cookie and falls back to local storage when a session cookie is not available. Flutter Uses a session cookie stored in Application Documents through the path_provider package. Apple Uses a session cookie stored in UserDefaults. Android Uses a session cookie stored in SharedPreferences. \"]}, {\"level\": 2, \"title\": \"Session Limits\", \"body\": [\"In Appwrite versions 1.2 and above, you can limit the number of active sessions created per user to prevent the accumulation of unused but active sessions. New sessions created by the same user past the session limit deletes the oldest session.\", \"You can change the session limit in the Security tab of the Auth Service in your Appwrite Console. The default session limit is 10 with a maximum configurable limit of 100.\"]}, {\"level\": 2, \"title\": \"Security\", \"body\": [\" Security is very important to protect users' data and privacy. Appwrite uses a permissions model coupled with user sessions to ensure users need correct permissions to access resources. With all Appwrite services, including databases and storage, access is granted at the collection, bucket, document, or file level. These permissions are enforced for client SDKs and server SDKs when using JWT, but are ignored when using a server SDK with an API key.\"]}, {\"level\": 2, \"title\": \"Password History\", \"body\": [\"Password history prevents users from reusing recent passwords. This protects user accounts from security risks by enforcing a new password everytime it's changed.\", \"Password history can be enabled in the Auth service's Security tab on the Appwrite console. You can choose how many previous passwords to remember up to a maximum of 20 and block users from reusing them.\"]}]", "metadata": {"source": "https://appwrite.io/docs/authentication-security"}} \ No newline at end of file diff --git a/docs/ee43d3f2-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43d3f2-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 5cd25a2..0000000 --- a/docs/ee43d3f2-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Functions \", \"body\": [\"Appwrite Functions allow you to extend and customize your Appwrite server functionality by executing your custom code. Appwrite can execute your custom code in response to any Appwrite system event like account creation, user login, or document update. You can also schedule your functions or start them manually by triggering your function from an HTTP endpoint using the Appwrite client or server APIs.\", \"Appwrite Functions run in a secure, isolated Docker container. By default, Appwrite supports multiple runtimes for different languages that you can use to run your code.\"]}, {\"level\": 2, \"title\": \"Getting Started\", \"body\": [\"The quickest way to get started with Appwrite Functions is using the Appwrite CLI. The CLI comes with starter code and some simple commands to quickly create and deploy your functions. Once you have the CLI installed and setup with an Appwrite project, create your first function using: \", \" appwrite init function\", \"Give your function a name and choose your runtime. This will create a new starter function in the current directory and also add it to your appwrite.json file. Go ahead and deploy your function using :\", \" appwrite deploy function\", \"You can now head over to your Appwrite Dashboard, navigate to the Function settings and execute your function. You can find the status of your execution under the Logs tab. \", \"Feel free to modify and play around with the starter code and use the appwrite deploy command to instantly deploy your changes to the Appwrite server. \", \" The following sections will dive deeper into some more terminology and advanced concepts which can be useful when writing your function from scratch.\"]}, {\"level\": 2, \"title\": \"Writing your own Function\", \"body\": [\"When writing your own Appwrite Function, you must export the code in certain ways depending on the language. This varies between languages so refer to the examples below.\", \" Node.js module.exports = async (req, res) => {\\n const payload =\\n req.payload ||\\n 'No payload provided. Add custom data when executing function.';\\n\\n const secretKey =\\n req.variables.SECRET_KEY ||\\n 'SECRET_KEY variable not found. You can set it in Function settings.';\\n\\n const randomNumber = Math.random();\\n\\n const trigger = req.variables.APPWRITE_FUNCTION_TRIGGER;\\n\\n res.json({\\n message: 'Hello from Appwrite!',\\n payload,\\n secretKey,\\n randomNumber,\\n trigger,\\n });\\n}; Installing Dependencies Include a package.json file along with your function, and Appwrite handles the rest! The best practice is to make sure that the node_modules folder is not a part of your tarball. PHP json([\\n 'message' => 'Hello from Appwrite!',\\n 'payload' => $payload,\\n 'secretKey' => $secretKey,\\n 'randomNumber' => $randomNumber,\\n 'trigger' => $trigger,\\n ]);\\n}; Installing Dependencies Include a composer.json file along with your function, make sure to require autoload.php from vendor folder, and Appwrite handles the rest!. The best practice is to make sure that the vendor directory is not a part of your tarball. Python import random\\n\\ndef main(req, res):\\n payload = req.payload or 'No payload provided. Add custom data when executing function.'\\n\\n secretKey = req.variables.get(\\n 'SECRET_KEY',\\n 'SECRET_KEY variable not found. You can set it in Function settings.'\\n )\\n\\n randomNumber = random.random()\\n\\n trigger = req.variables['APPWRITE_FUNCTION_TRIGGER']\\n\\n return res.json({\\n 'message': 'Hello from Appwrite!',\\n 'payload': payload,\\n 'secretKey': secretKey,\\n 'randomNumber': randomNumber,\\n 'trigger': trigger,\\n }) Installing Dependencies Include a requirements.txt file with your function, Appwrite handles the rest! Ruby def main(req, res)\\n payload =\\n !req.payload.empty? ? req.payload :\\n 'No payload provided. Add custom data when executing function.'\\n\\n secretKey =\\n req.variables['SECRET_KEY'] ||\\n 'SECRET_KEY variable not found. You can set it in Function settings.'\\n\\n randomNumber = rand()\\n\\n trigger = req.variables['APPWRITE_FUNCTION_TRIGGER']\\n\\n return res.json({\\n :message => 'Hello from Appwrite!',\\n :payload => payload,\\n :secretKey => secretKey,\\n :randomNumber => randomNumber,\\n :trigger => trigger,\\n })\\nend Installing Dependencies Include a Gemfile with your function, Appwrite handles the rest! Deno export default async function (req: any, res: any) {\\n const payload =\\n req.payload ||\\n 'No payload provided. Add custom data when executing function.';\\n\\n const secretKey =\\n req.variables.SECRET_KEY ||\\n 'SECRET_KEY variable not found. You can set it in Function settings.';\\n\\n const randomNumber = Math.random();\\n\\n const trigger = req.variables.APPWRITE_FUNCTION_TRIGGER;\\n\\n res.json({\\n message: 'Hello from Appwrite!',\\n payload,\\n secretKey,\\n randomNumber,\\n trigger,\\n });\\n}; Installing Dependencies No special steps are required for Deno, Appwrite handles everything! Dart import 'dart:math';\\nimport 'dart:async';\\n\\nFuture start(final req, final res) async {\\n final payload =\\n !req.payload?.isEmpty ? req.payload :\\n 'No payload provided. Add custom data when executing function.';\\n\\n final secretKey =\\n req.variables['SECRET_KEY'] ??\\n 'SECRET_KEY variable not found. You can set it in Function settings.';\\n\\n final randomNumber = new Random().nextDouble();\\n\\n final trigger = req.variables['APPWRITE_FUNCTION_TRIGGER'];\\n\\n res.json({\\n 'message': 'Hello from Appwrite!',\\n 'payload': payload,\\n 'secretKey': secretKey,\\n 'randomNumber': randomNumber,\\n 'trigger': trigger,\\n });\\n} Installing Dependencies Include a pubspec.yaml file with your function- Appwrite handles the rest! Swift func main(req: RequestValue, res: RequestResponse) throws -> RequestResponse {\\n let payload = req.payload.isEmpty \\n ? \\\"No payload provided. Add custom data when executing function\\\" \\n : req.payload\\n \\n let secretKey = req.variables[\\\"SECRET_KEY\\\"] \\n ?? \\\"SECRET_KEY variable not found. You can set it in Function settings.\\\"\\n\\n let randomNumber = Double.random(in: 0...1)\\n\\n let trigger = req.variables[\\\"APPWRITE_FUNCTION_TRIGGER\\\"]\\n\\n return res.json(data: [\\n \\\"message\\\": \\\"Hello from Appwrite!\\\",\\n \\\"payload\\\": payload,\\n \\\"secretKey\\\": secretKey,\\n \\\"randomNumber\\\": randomNumber,\\n \\\"trigger\\\": trigger,\\n ])\\n} With Swift, your entrypoint can be empty since Appwrite automatically infers it from the location of your main() function. Just ensure that your cloud function has a single declaration of main() across your source files. Installing Dependencies Include a Package.swift file with your function, Appwrite handles the rest! .NET public async Task Main(RuntimeRequest req, RuntimeResponse res)\\n{\\n var payload = (string.IsNullOrEmpty(req.Payload))\\n ? \\\"No payload provided. Add custom data when executing function.\\\"\\n : req.Payload; \\n\\n var secretKey = req.Variables.ContainsKey(\\\"SECRET_KEY\\\")\\n ? req.Variables[\\\"SECRET_KEY\\\"]\\n : \\\"SECRET_KEY variable not found. You can set it in Function settings.\\\";\\n\\n var randomNumber = new Random().NextDouble();\\n\\n var trigger = req.Variables[\\\"APPWRITE_FUNCTION_TRIGGER\\\"];\\n\\n return res.Json(new() \\n {\\n { \\\"message\\\", \\\"Hello from Appwrite!\\\" },\\n { \\\"payload\\\", payload },\\n { \\\"secretKey\\\", secretKey },\\n { \\\"randomNumber\\\", randomNumber },\\n { \\\"trigger\\\", trigger },\\n });\\n} Installing Dependencies Include a Function.csproj file with your function, Appwrite handles the rest! Kotlin import kotlin.random.Random\\n\\n@Throws(Exception::class)\\nfun main(req: RuntimeRequest, res: RuntimeResponse): RuntimeResponse {\\n\\n val payload = if (req.payload.isEmpty()) \\\"No payload provided. Add custom data when executing function.\\\" else req.payload\\n\\n val secretKey = req.variables[\\\"SECRET_KEY\\\"] ?: \\\"SECRET_KEY variable not found. You can set it in Function settings.\\\"\\n \\n val randomNumber = Random.nextDouble(0.0, 1.0)\\n\\n val trigger = req.variables[\\\"APPWRITE_FUNCTION_TRIGGER\\\"] \\n\\n return res.json(mapOf(\\n \\\"message\\\" to \\\"Hello from Appwrite!\\\",\\n \\\"payload\\\" to payload,\\n \\\"secretKey\\\" to secretKey,\\n \\\"randomNumber\\\" to randomNumber,\\n \\\"trigger\\\" to trigger\\n ))\\n} Installing Dependencies Include a deps.gradle file with your function, Appwrite handles the rest! Java import java.util.Map;\\nimport java.util.HashMap;\\n\\npublic RuntimeResponse main(RuntimeRequest req, RuntimeResponse res) throws Exception {\\n\\n String payload = (req.getPayload().isEmpty())\\n ? \\\"No payload provided. Add custom data when executing function.\\\"\\n : req.getPayload();\\n\\n Map variables = req.getVariables();\\n\\n String secretKey = variables.containsKey(\\\"SECRET_KEY\\\")\\n ? variables.get(\\\"SECRET_KEY\\\")\\n : \\\"SECRET_KEY variable not found. You can set it in Function settings.\\\";\\n\\n double randomNumber = Math.random();\\n\\n String trigger = variables.get(\\\"APPWRITE_FUNCTION_TRIGGER\\\");\\n\\n Map response = new HashMap();\\n response.put(\\\"message\\\", \\\"Hello from Appwrite!\\\");\\n response.put(\\\"payload\\\", payload);\\n response.put(\\\"secretKey\\\", secretKey);\\n response.put(\\\"randomNumber\\\", randomNumber);\\n response.put(\\\"trigger\\\", trigger);\\n\\n return res.json(response);\\n} Installing Dependencies Include a deps.gradle file with your function, Appwrite handles the rest! C++ #include \\n#include \\n\\nstatic RuntimeResponse &main(const RuntimeRequest &req, RuntimeResponse &res) {\\n\\n std::string payload = req.payload.empty() ? \\n \\\"No payload provided. Add custom data when executing function.\\\" : \\n req.payload;\\n\\n std::string secretKey = req.variables.get(\\\"SECRET_KEY\\\", \\\"SECRET_KEY variable not found. You can set it in Function settings.\\\").asString();\\n\\n double randomNumber = ((double) rand() / (RAND_MAX));\\n\\n std::string trigger = req.variables[\\\"APPWRITE_FUNCTION_TRIGGER\\\"].asString();\\n\\n Json::Value response;\\n response[\\\"message\\\"] = \\\"Hello from Appwrite!\\\";\\n response[\\\"payload\\\"] = payload;\\n response[\\\"secretKey\\\"] = secretKey;\\n response[\\\"randomNumber\\\"] = randomNumber;\\n response[\\\"trigger\\\"] = trigger;\\n \\n return res.json(response);\\n} Installing Dependencies Include a CMakeLists.txt file with your function, Appwrite handles the rest! \", \"When your function is called, you receive two parameters, a request and a response object. The request object contains all data that was sent to the function including function variables. A schema of the request object can be found below and is the same for all runtimes.\", \" Property Description headers An object containing all the request headers. payload A JSON string containing the data when you created the execution. variables An object containing all the function variables. This includes variables automatically added by Appwrite. \", \"The response object has two functions, send() and json() that can be used to send data back to the client. The types and implementation of these functions vary depending on runtime due to all languages being slightly different. You can check out implementation in the specific languages to learn more about them. The schema of the response object can be found below: \", \" Function Description send(text, status) Function to return a text response. Status code defaults to 200 json(obj, status) Function to return a JSON response. Status code defaults to 200 \"]}, {\"level\": 2, \"title\": \"Create your Function\", \"body\": [\"Before you can deploy your function, you will need to create a new function from your Appwrite project's dashboard. Access the Function settings from your project's left navigation panel. Click the 'Add Function' button and choose a function name and runtime. In your Functions settings page, you can also set your function event triggers, CRON schedule, and set secure function variables for your function. \"]}, {\"level\": 2, \"title\": \"Deploy Your Function\", \"body\": [\"Once you've written your function, you can now deploy it using the Appwrite CLI, the Appwrite Server API or manually from the Appwrite console.\", \" Unix appwrite functions createDeployment \\\\\\n --functionId=6012cc93d5a7b \\\\\\n --activate=true \\\\\\n --entrypoint=\\\"index.js\\\" \\\\\\n --code=\\\".\\\" CMD appwrite functions createDeployment ^\\n --functionId=6012cc93d5a7b ^\\n --activate=true ^\\n --entrypoint=\\\"index.js\\\" ^\\n --code=\\\".\\\" PowerShell appwrite functions createDeployment `\\n --functionId=6012cc93d5a7b `\\n --activate=true `\\n --entrypoint=\\\"index.js\\\" `\\n --code=\\\".\\\" \", \"The command above accepts three parameters:\", \" Name Description functionId The ID of the Function you created in the previous step. You can find your function ID on your function page in your project dashboard. entrypoint The file name of your custom code that is executed when the function is triggered. code Path to your function tarball. When used with the Appwrite CLI, simply pass the path to your code directory, and the CLI will automatically package your code. \", \" You can also create new code deployments using the Appwrite server API\"]}, {\"level\": 3, \"title\": \"Manual Deployment\", \"body\": [\"You can also upload your functions to be deployed using the Appwrite console. The example below shows a simple Node.JS function, but the same idea applies to any other language.\", \" .\\n\\u251c\\u2500\\u2500 package.json\\n\\u2514\\u2500\\u2500 index.js\\n\", \"First, navigate inside the folder that contains your dependency file. Package your code files into the .tar.gz format with this tar command:\", \" Unix tar -czf code.tar.gz --exclude code.tar.gz . CMD tar -czf code.tar.gz --exclude code.tar.gz . PowerShell tar -czf code.tar.gz --exclude code.tar.gz . \", \"Next, navigate to your Appwrite console and upload the function.\", \" Navigate to the function you want to deploy. Click Create deployment. Select the Manual tab. Input the entry point of your function under Entrypoint. For the example above, it would be index.js. Upload code.tar.gz. Select Activate deployment after build to use your new function. Click Create to deploy your function.\"]}, {\"level\": 2, \"title\": \"Builds\", \"body\": [\"Deployments needs to be built before they can be activated. This is automatically done after creating a deployment and the time taken can vary depending on the runtime.\", \"If a build fails for any reason, the deployment's status is set to failed and you won't be able to activate it. You can however retry a build if you think it was caused by an external factor using the Retry Button on the Appwrite Dashboard or Retry Build endpoint with the buildId from the deployment.\", \"To find more details about a deployment and reasons for its failure, you can use the Get Deployment endpoint using the deploymentId.\", \"Deployments that have been built successfully are marked as ready and can be activated and executed.\", \" Build Times Compiled runtimes such as Rust and Swift take much longer to build however yield better performance over their interpreted counterparts such as Node.\"]}, {\"level\": 2, \"title\": \"Execute\", \"body\": [\"Besides setting a schedule or allowing your function to listen to Appwrite's system events, you can also manually execute your cloud functions from your Appwrite console or API.\", \" Function settings page. \", \"To execute a function from the Appwrite console, click the Execute Now button on your function's overview page. To execute a function from the API, send a POST request to the function execution endpoint.\", \"The function execution endpoint is available from both Appwrite client and server APIs. To execute your function from the server API, you need an API key with 'execution.write' scope.\", \"Executing the function from the client API requires the current user to have execution permission for the function. You can change the execution permission from the function's settings page in the Appwrite console, by default no user, team, or role has this permission.\", \" Web import { Client, Functions } from \\\"appwrite\\\";\\n\\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst functions = new Functions(client);\\n\\nlet promise = functions.createExecution('[FUNCTION_ID]');\\n\\npromise.then(function (response) {\\n console.log(response); // Success\\n}, function (error) {\\n console.log(error); // Failure\\n}); Flutter import 'package:appwrite/appwrite.dart';\\n\\nvoid main() async {\\n final client = Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\n final functions = Functions(client);\\n\\n final execution = await functions.createExecution(\\n functionId: '[FUNCTION_ID]'\\n );\\n} Android import io.appwrite.Client\\nimport io.appwrite.services.Functions\\n\\nsuspend fun main() {\\n val client = Client(applicationContext)\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n val functions = Functions(client)\\n\\n val execution = functions.createExecution(\\n functionId = \\\"[FUNCTION_ID]\\\"\\n )\\n} Apple import Appwrite\\n\\nfunc main() async throws {\\n let client = Client()\\n .setEndpoint(\\\"https://cloud.appwrite.io/v1\\\")\\n .setProject(\\\"[PROJECT_ID]\\\")\\n\\n let functions = Functions(client)\\n\\n let execution = try await functions.createExecution(\\n functionId: \\\"[FUNCTION_ID]\\\"\\n )\\n} GraphQL mutation {\\n functionsCreateExecution(functionId: \\\"[FUNCTION_ID]\\\") {\\n _id\\n statusCode\\n response\\n stdout\\n stderr\\n duration\\n }\\n} \"]}, {\"level\": 2, \"title\": \"Scheduled Execution\", \"body\": [\"Appwrite supports scheduled function executions. You can schedule executions using cron expressions in the settings of your function. Cron supports recurring executions as frequently as every minute.\", \"Here are some cron expressions for common intervals.\", \" Cron Expression Schedule */15 * * * * Every 15 minutes 0 * * * * Every Hour 0 0 * * * Every day at 00:00 0 0 * * 1 Every monday at 00:00 \"]}, {\"level\": 3, \"title\": \"Abuse and Limits\", \"body\": [\"Appwrite Functions can be executed using Client or Server SDKs. Client SDKs must be authenticated with an account that has been granted execution permissions on the function's settings page. Server SDKs require an API key with the correct scopes.\", \"The Functions Service APIs are rate limited to 60 calls per minute per account when using a Client SDK. Learn more about rate limiting. The response size of a Cloud Function is limited to 1MB. Responses larger than 1MB should be handled using Appwrite's Databases or Storage service.\", \"Each execution has a default timeout of 15 seconds to prevent hanging functions from blocking resources. This timeout can be configured per function on a function's settings page or in appwrite.json for up to 900 seconds.\"]}, {\"level\": 2, \"title\": \"Ignore Files\", \"body\": [\"Library folders such as node_modules or vendor should not be included in your tarball since these dependencies will be installed during your function's build process. Similarly, you should not include files containing secrets in your deployment. You can use the Appwite CLI's file ignoring feature to exclude specific files from a deployment.\", \"You can use the ignore property in your appwrite.json file to specify which files and folders should be ignored. This value must be an array of paths, as seen in the example below:\", \" {\\n ...\\n \\\"functions\\\": [\\n {\\n \\\"$id\\\": \\\"6213b58cb21dda6c3263\\\",\\n \\\"name\\\": \\\"My Awesome Function\\\",\\n \\\"runtime\\\": \\\"node-17.0\\\",\\n \\\"path\\\": \\\"My Awesome Function\\\",\\n \\\"entrypoint\\\": \\\"src/index.js\\\",\\n \\\"ignore\\\": [ \\\"node_modules\\\", \\\".env\\\" ]\\n },\\n ...\\n ],\\n}\", \"The example configuration above would not deploy the folder node_modules and the file .env.\", \"Alternatively, you can add a .gitignore file into your function folder and Appwrite CLI will ignore files specified in there. Keep in mind that if present, the ignore configuration in appwrite.json will nullify your ignore file.\", \"If you need to use a .gitignore file for your version control but don't want the Appwrite CLI to use it, you can specify the ignore key in appwrite.json to be an empty array.\"]}, {\"level\": 2, \"title\": \"Supported Runtimes\", \"body\": [\"Appwrite provides multiple code runtimes to execute your custom functions. Each runtime uses a Docker image tied to a specific language version to provide a safe, isolated playground to run your team's code.\", \"Below is a list of supported Cloud Functions runtimes. The Appwrite team continually adds support for new runtimes.\", \" Name Image Architectures node-14.5 openruntimes/node:v2-14.5 x86 / arm node-16.0 openruntimes/node:v2-16.0 x86 / arm node-18.0 openruntimes/node:v2-18.0 x86 / arm php-8.0 openruntimes/php:v2-8.0 x86 / arm php-8.1 openruntimes/php:v2-8.1 x86 / arm ruby-3.0 openruntimes/ruby:v2-3.0 x86 / arm ruby-3.1 openruntimes/ruby:v2-3.1 x86 / arm python-3.8 openruntimes/python:v2-3.8 x86 / arm python-3.9 openruntimes/python:v2-3.9 x86 / arm python-3.10 openruntimes/python:v2-3.10 x86 / arm deno-1.21 openruntimes/deno:v2-1.21 x86 deno-1.24 openruntimes/deno:v2-1.24 x86 dart-2.15 openruntimes/dart:v2-2.15 x86 / arm dart-2.16 openruntimes/dart:v2-2.16 x86 / arm dart-2.17 openruntimes/dart:v2-2.17 x86 / arm dotnet-3.1 openruntimes/dotnet:v2-3.1 x86 / arm dotnet-6.0 openruntimes/dotnet:v2-6.0 x86 / arm java-8.0 openruntimes/java:v2-8.0 x86 / arm java-11.0 openruntimes/java:v2-11.0 x86 / arm java-17.0 openruntimes/java:v2-17.0 x86 / arm java-18.0 openruntimes/java:v2-18.0 x86 / arm swift-5.5 openruntimes/swift:v2-5.5 x86 / arm kotlin-1.6 openruntimes/kotlin:v2-1.6 x86 / arm cpp-17.0 openruntimes/cpp:v2-17 x86 / arm \", \"By default, the following runtimes are enabled: node-16.0, php-8.0, python-3.9, ruby-3.0, and dart-2.17.\"]}, {\"level\": 2, \"title\": \"Function Variables\", \"body\": [\"Function variables supplied by Appwrite in addition to your own defined function variables that you can access from your function code. These variables give you information about your execution runtime environment.\", \" Name Description APPWRITE_FUNCTION_ID Your function's unique ID. APPWRITE_FUNCTION_NAME Your function's name. APPWRITE_FUNCTION_DEPLOYMENT Your function's code deployment unique ID. APPWRITE_FUNCTION_TRIGGER Either 'event' when triggered by one of the selected scopes, 'http' when triggered by an HTTP request or the Appwrite Console, or 'schedule' when triggered by the cron schedule. APPWRITE_FUNCTION_RUNTIME_NAME Your function runtime name. Can be any of Appwrite supported execution runtimes. APPWRITE_FUNCTION_RUNTIME_VERSION Your function runtime version. APPWRITE_FUNCTION_EVENT Your function event name. This value is available only when your function trigger is 'event.' This variable value can be any of Appwrite system events. APPWRITE_FUNCTION_EVENT_DATA Your function event payload. This value is available only when your function trigger is 'event'. This variable value contains a string in JSON format with your specific event data. APPWRITE_FUNCTION_DATA version >= 0.8.0 Your function's custom execution data. This variable's value contains a string in any format. If the custom data is in JSON FORMAT, it must be parsed inside the function code. Note that this variable can be set only when triggering a function using the SDK or HTTP API and the Appwrite Dashboard. APPWRITE_FUNCTION_PROJECT_ID version >= 0.8.0 Your function's project ID. APPWRITE_FUNCTION_USER_ID version >= 0.8.0 The userId of the user that triggered your function's execution. Executions triggered in the Appwrite console will be prepended with \\\"admin-\\\". APPWRITE_FUNCTION_JWT version >= 0.8.0 A JSON Web Token generated for the user that executes your function. APPWRITE_FUNCTION_EVENT_PAYLOAD version < 0.8.0 (deprecated) Your function event payload. Deprecated in favor of APPWRITE_FUNCTION_EVENT_DATA in version 0.8.0. APPWRITE_FUNCTION_ENV_NAME version < 0.8.0 (deprecated) Your function environment name. Can be any of Appwrite supported execution environments. APPWRITE_FUNCTION_ENV_VERSION version < 0.8.0 (deprecated) Your function environment version. \", \" Using an Appwrite SDK in Your Function Appwrite Server SDKs require an API key, an endpoint, and a project ID for authentication. Appwrite passes in your project ID with the function variable APPWRITE_FUNCTION_PROJECT_ID, but not the endpoint and API key. If you need to use a Server SDK, you will need to add function variables for your endpoint and API key in the Settings tab of your function. If you are running a local Appwrite instance, you will need to pass in the machine's public IP instead of 'https://localhost/v1'. Localhost inside the function's runtime container is not the same as localhost of your machine.\"]}, {\"level\": 2, \"title\": \"Appwrite SDKs in Functions\", \"body\": [\"You can integrate Appwrite Functions with other Appwrite services by using the appropriate Server SDK for your runtime. You can find starter code for your function's runtime in the Appwrite Function Starter repository.\", \"To initialize a Server SDK in a function, you need to provide your Appwrite endpoint and an API key in the Variables tab of your Function. The ID of your Appwrite project is passed in automatically as APPWRITE_FUNCTION_PROJECT_ID.\"]}, {\"level\": 2, \"title\": \"Monitor & Debug\", \"body\": [\"You can monitor your function execution usage stats and logs from your Appwrite console. To access your functions usage stats and logs, click the Usage tab in your function dashboard.\", \"The usage screen in your console will allow you to track the number of execution and your function CPU usage time. You can also review a detailed log of your function execution history, including the function exit code, output log, and error log.\", \" Function usage and logs tracking. \"]}]", "metadata": {"source": "https://appwrite.io/docs/functions"}} \ No newline at end of file diff --git a/docs/ee43db90-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43db90-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index f04e3b4..0000000 --- a/docs/ee43db90-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Permissions \", \"body\": [\"Appwrite permission mechanism offers a simple, yet flexible way to manage which users, teams, or roles can access a specific resource in your project, like documents and files.\", \"Using permissions, you can decide that only user A and user B will have read and update access to a specific database document, while user C and team X will be the only ones with delete access.\", \"As the name suggests, read permission allows a user to read a resource, create allows users to create new resources, update allows a user to make changes to a resource, and delete allows the user to remove the resource.\", \"All permissions can be granted to individuals or groups of users, entire teams, or only to team members with a specific role. Permission can also be granted based on authentication status such as to all users, only authenticated users, or only guest users.\", \"A project user can only grant a resource with permissions that they own. For example, if a user is trying to share a document with a team that they are not a member of, they will encounter a 401 not authorized error. If your app needs users to grant access to teams they're not a member of, you can create Appwrite Functions with a Server SDK to achieve this functionality.\", \" Appwrite Resource An Appwrite resource can be a database, collection, document, bucket, or file. Each resource has its own set of permissions to define who can interact with it. Using the Appwrite permissions mechanism, you can grant resource access to users, teams, and members with different roles.\"]}, {\"level\": 2, \"title\": \"Default Values\", \"body\": [\"When not providing a resource with read or write permissions, the default value will be empty. When a read or write permissions is missing, no one will be granted access control to the resource.\"]}, {\"level\": 2, \"title\": \"Server Integration\", \"body\": [\"Server integrations can be used for increased flexibility. When using a Server SDK in combination with the proper API key scopes, you can have any type of access to any of your project resources regardless of their permissions.\", \"Using the server integration flexibility, you can change resource permissions, share resources between different users and teams, or edit and delete them without any limitations.\"]}, {\"level\": 2, \"title\": \"Permission Types\", \"body\": [\"In Client and Server SDKs, you will find a Permission class with helper methods for each role described below.\", \" Type Description Permission.read() Access to read a resource. Permission.create() Access to create new resources. Does not apply to files or documents. Applying this type of access to files or documents results in an error. Permission.update() Access to change a resource, but not remove or create new resources. Does not apply to functions. Permission.delete() Access to remove a resource. Does not apply to functions. Permission.write() Alias to grant create, update, and delete access for collections and buckets and update and delete access for documents and files. \"]}, {\"level\": 2, \"title\": \"Permission Roles\", \"body\": [\"In Client and Server SDKs, you will find a Role class with helper methods for each role described below.\", \" Type Description Role.any() Grants access to anyone. Role.guests() Grants access to any guest user without a session. Authenticated users don't have access to this role. Role.users([STATUS]) Grants access to any authenticated or anonymous user. You can optionally pass the verified or unverified string to target specific types of users. Role.user([USER_ID], [STATUS]) Grants access to a specific user by user ID. You can optionally pass the verified or unverified string to target specific types of users. Role.team([TEAM_ID]) Grants access to any member of the specific team. To gain access to this permission, the user must be the team creator (owner), or receive and accept an invitation to join this team. Role.team([TEAM_ID], [ROLE]) Grants access to any member who possesses a specific role in a team. To gain access to this permission, the user must be a member of the specific team and have the given role assigned to them. Team roles can be assigned when inviting a user to become a team member. Role.member([MEMBERSHIP_ID]) Grants access to a specific member of a team. When the member is removed from the team, they will no longer have access. \"]}, {\"level\": 2, \"title\": \"Examples\", \"body\": [\"The examples below will show you how you can use the different Appwrite permissions to manage access control to your project resources.\", \"The following examples are using the Appwrite Web SDK but can be applied similarly to any of the other Appwrite SDKs.\"]}, {\"level\": 3, \"title\": \"Example #1 - Basic Usage\", \"body\": [\"In the following example, we are creating a document that can be read by anyone, edited by writers or admins, and deleted by administrators or a user with the user ID user:5c1f88b42259e.\", \" import { Client, Databases, Permission, Role } from \\\"appwrite\\\";\\n \\nconst client = new Client()\\n .setEndpoint('https://cloud.appwrite.io/v1')\\n .setProject('[PROJECT_ID]');\\n\\nconst databases = new Databases(client);\\n\\nlet promise = databases.createDocument(\\n '[DATABASE_ID]',\\n '[COLLECTION_ID]',\\n {'actorName': 'Chris Evans', 'height': 183},\\n [\\n Permission.read(Role.any()), // Anyone can view this document\\n Permission.update(Role.team(\\\"writers\\\")), // Writers can update this document\\n Permission.update(Role.team(\\\"admin\\\")), // Admins can update this document\\n Permission.delete(Role.user(\\\"5c1f88b42259e\\\")) // User 5c1f88b42259e can delete this document\\n Permission.delete(Role.team(\\\"admin\\\")) // Admins can delete this document\\n ]\\n);\\n\\npromise.then(function (response) {\\n console.log(response);\\n}, function (error) {\\n console.log(error);\\n});\"]}]", "metadata": {"source": "https://appwrite.io/docs/permissions"}} \ No newline at end of file diff --git a/docs/ee43df5a-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43df5a-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 9c2d69c..0000000 --- a/docs/ee43df5a-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Events \", \"body\": [\"Appwrite provides a variety of events that allows your application to react to changes as they happen. A event will fire when a change occurs in your Appwrite project, like when a new user registers or a new file is uploaded to Appwrite. You can subscribe to these events to with Appwrite Functions, Realtime, or Webhooks.\", \"You can subscribe to events for specific resources using their ID or subscribe to changes of all resources of the same type by using a wildcard character * instead of an ID. You can also filter for events of specific actions like create, update, or delete. You can find a list of events for Storage, Databases, Functions, and Authentication services below.\"]}, {\"level\": 2, \"title\": \"Storage Service\", \"body\": [\" Name Payload Description buckets.* Bucket Object This event triggers on any buckets event. buckets.*.create Bucket Object This event triggers when a bucket is created. buckets.*.delete Bucket Object This event triggers when a bucket is deleted. buckets.*.files.* File Object This event triggers on any files event. buckets.*.files.*.create File Object This event triggers when a file is created. buckets.*.files.*.delete File Object This event triggers when a file is deleted. buckets.*.files.*.update File Object This event triggers when a file is updated. buckets.*.update Bucket Object This event triggers when a bucket is updated. \"]}, {\"level\": 2, \"title\": \"Databases Service\", \"body\": [\" Name Payload Description databases.* Database Object This event triggers on any database event. databases.*.collections.* Collection Object This event triggers on any collection event. databases.*.collections.*.attributes Attribute Object This event triggers on any attributes event. databases.*.collections.*.attributes.*.create Attribute Object This event triggers when an attribute is created. databases.*.collections.*.attributes.*.delete Attribute Object This event triggers when an attribute is deleted. databases.*.collections.*.create Collection Object This event triggers when a collection is created. databases.*.collections.*.delete Collection Object This event triggers when a collection is deleted. databases.*.collections.*.documents Document Object This event triggers on any documents event. databases.*.collections.*.documents.*.create Document Object This event triggers when a document is created. databases.*.collections.*.documents.*.delete Document Object This event triggers when a document is deleted. databases.*.collections.*.documents.*.update Document Object This event triggers when a document is updated. databases.*.collections.*.indexes Index Object This event triggers on any indexes event. databases.*.collections.*.indexes.*.create Index Object This event triggers when an index is created. databases.*.collections.*.indexes.*.delete Index Object This event triggers when an index is deleted. databases.*.collections.*.update Collection Object This event triggers when a collection is updated. databases.*.create Database Object This event triggers when a database is created. databases.*.delete Database Object This event triggers when a database is deleted. databases.*.update Database Object This event triggers when a database is updated. \"]}, {\"level\": 2, \"title\": \"Functions Service\", \"body\": [\" Name Payload Description functions.* Function Object This event triggers on any functions event. functions.*.create Function Object This event triggers when a function is created. functions.*.delete Function Object This event triggers when a function is deleted. functions.*.deployments.* Deployment Object This event triggers on any deployments event. functions.*.deployments.*.create Deployment Object This event triggers when a deployment is created. functions.*.deployments.*.delete Deployment Object This event triggers when a deployment is deleted. functions.*.deployments.*.update Deployment Object This event triggers when a deployment is updated. functions.*.executions.* Execution Object This event triggers on any executions event. functions.*.executions.*.create Execution Object This event triggers when an execution is created. functions.*.executions.*.delete Execution Object This event triggers when an execution is deleted. functions.*.executions.*.update Execution Object This event triggers when an execution is updated. functions.*.update Function Object This event triggers when a function is updated. \"]}, {\"level\": 2, \"title\": \"Authentication Service\", \"body\": [\" Name Payload Description teams.* Team Object This event triggers on any teams event. teams.*.create Team Object This event triggers when a team is created. teams.*.delete Team Object This event triggers when a team is deleted. teams.*.memberships.* Membership Object This event triggers on any team memberships event. teams.*.memberships.*.create Membership Object This event triggers when a membership is created. teams.*.memberships.*.delete Membership Object This event triggers when a membership is deleted. teams.*.memberships.*.update Membership Object This event triggers when a membership is updated. teams.*.memberships.*.update.*.status Membership Object This event triggers when a team memberships status is updated. teams.*.update Team Object This event triggers when a team is updated. teams.*.update.*.prefs Team Object This event triggers when a team's preferences are updated. users.* User Object This event triggers on any user's event. users.*.create User Object This event triggers when a user is created. users.*.delete User Object This event triggers when a user is deleted. users.*.recovery.* Token Object This event triggers on any user's recovery token event. users.*.recovery.*.create Token Object This event triggers when a recovery token for a user is created. users.*.recovery.*.update Token Object This event triggers when a recovery token for a user is validated. users.*.sessions.* Session Object This event triggers on any user's sessions event. users.*.sessions.*.create Session Object This event triggers when a session for a user is created. users.*.sessions.*.delete Session Object This event triggers when a session for a user is deleted. users.*.update User Object This event triggers when a user is updated. users.*.update.*.email User Object This event triggers when a user's email address is updated. users.*.update.*.name User Object This event triggers when a user's name is updated. users.*.update.*.password User Object This event triggers when a user's password is updated. users.*.update.*.prefs User Object This event triggers when a user's preferences is updated. users.*.update.*.status User Object This event triggers when a user's status is updated. users.*.verification.* Token Object This event triggers on any user's verification token event. users.*.verification.*.create Token Object This event triggers when a verification token for a user is created. users.*.verification.*.update Token Object This event triggers when a verification token for a user is validated. \"]}]", "metadata": {"source": "https://appwrite.io/docs/events"}} \ No newline at end of file diff --git a/docs/ee43f3aa-1f0c-11ee-98fa-00155da08df7.json b/docs/ee43f3aa-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 9c4cf18..0000000 --- a/docs/ee43f3aa-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Environment Variables \", \"body\": [\"Appwrite environment variables allow you to edit your server setup configuration and customize it. You can easily change the environment variables by changing them when running Appwrite using Docker CLI or Docker Compose.\", \"Updating your Appwrite environment variables requires you to edit your Appwrite .env file. Your Docker files should be located inside the \\\"appwrite\\\" folder at the location where you first run the Appwrite installation script. It's recommended to use the .env file as a central point for updating your Appwrite configuration rather than changing them directly in your docker-compose.yml file.\", \"After editing your docker-compose.yml or .env files, you will need to recreate your Appwrite stack by running the following compose command in your terminal:\", \" docker compose up -d\", \"You can verify if the changes have been successfully applied by running this command:\", \" docker compose exec appwrite vars\", \"All Options:\", \" General Redis MariaDB InfluxDB StatsD SMTP Phone Storage Functions Maintenance GraphQL \"]}, {\"level\": 2, \"title\": \"General\", \"body\": [\" Name Description _APP_ENV Set your server running environment. By default, the var is set to 'development'. When deploying to production, change it to: 'production'. _APP_LOCALE Set your Appwrite's locale. By default, the locale is set to 'en'. _APP_OPTIONS_ABUSE Allows you to disable abuse checks and API rate limiting. By default, set to 'enabled'. To cancel the abuse checking, set to 'disabled'. It is not recommended to disable this check-in a production environment. _APP_OPTIONS_FORCE_HTTPS Allows you to force HTTPS connection to your API. This feature redirects any HTTP call to HTTPS and adds the 'Strict-Transport-Security' header to all HTTP responses. By default, set to 'enabled'. To disable, set to 'disabled'. This feature will work only when your ports are set to default 80 and 443. _APP_OPENSSL_KEY_V1 This is your server private secret key that is used to encrypt all sensitive data on your server. Appwrite server encrypts all secret data on your server like webhooks, HTTP passwords, user sessions, and storage files. The var is not set by default, if you wish to take advantage of Appwrite encryption capabilities you should change it and make sure to keep it a secret and have a backup for it. _APP_DOMAIN Your Appwrite domain address. When setting a public suffix domain, Appwrite will attempt to issue a valid SSL certificate automatically. When used with a dev domain, Appwrite will assign a self-signed SSL certificate. The default value is 'localhost'. _APP_DOMAIN_TARGET A DNS A record hostname to serve as a CNAME target for your Appwrite custom domains. You can use the same value as used for the Appwrite '_APP_DOMAIN' variable. The default value is 'localhost'. _APP_CONSOLE_WHITELIST_ROOT version >= 0.8.0 This option allows you to disable the creation of new users on the Appwrite console. When enabled only 1 user will be able to use the registration form. New users can be added by inviting them to your project. By default this option is enabled. _APP_CONSOLE_WHITELIST_EMAILS This option allows you to limit creation of new users on the Appwrite console. This option is very useful for small teams or sole developers. To enable it, pass a list of allowed email addresses separated by a comma. _APP_CONSOLE_WHITELIST_IPS This last option allows you to limit creation of users in Appwrite console for users sharing the same set of IP addresses. This option is very useful for team working with a VPN service or a company IP.To enable/activate this option, pass a list of allowed IP addresses separated by a comma. _APP_SYSTEM_EMAIL_NAME version >= 0.7.0 This is the sender name value that will appear on email messages sent to developers from the Appwrite console. The default value is: 'Appwrite'. You can use url encoded strings for spaces and special chars. _APP_SYSTEM_EMAIL_ADDRESS version >= 0.7.0 This is the sender email address that will appear on email messages sent to developers from the Appwrite console. The default value is 'team@appwrite.io'. You should choose an email address that is allowed to be used from your SMTP server to avoid the server email ending in the users' SPAM folders. _APP_SYSTEM_RESPONSE_FORMAT version >= 0.7.0 Use this environment variable to set the default Appwrite HTTP response format to support an older version of Appwrite. This option is useful to overcome breaking changes between versions. You can also use the X-Appwrite-Response-Format HTTP request header to overwrite the response for a specific request. This variable accepts any valid Appwrite version. To use the current version format, leave the value of the variable empty. _APP_SYSTEM_SECURITY_EMAIL_ADDRESS version >= 0.7.0 This is the email address used to issue SSL certificates for custom domains or the user agent in your webhooks payload. _APP_USAGE_STATS version >= 0.7.0 This variable allows you to disable the collection and displaying of usage stats. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'. When disabled, it's recommended to turn off the Worker Usage, Influxdb and Telegraf containers for better resource usage. _APP_LOGGING_PROVIDER version >= 0.12.0 This variable allows you to enable logging errors to 3rd party providers. This value is empty by default, to enable the logger set the value to one of 'sentry', 'raygun', 'appSignal', 'logOwl' _APP_LOGGING_CONFIG version >= 0.12.0 This variable configures authentication to 3rd party error logging providers. If using Sentry, this should be 'SENTRY_API_KEY;SENTRY_APP_ID'. If using Raygun, this should be Raygun API key. If using AppSignal, this should be AppSignal API key. If using LogOwl, this should be LogOwl Service Ticket. _APP_USAGE_AGGREGATION_INTERVAL version >= 1.1.0 Interval value containing the number of seconds that the Appwrite usage process should wait before aggregating stats and syncing it to Database from TimeSeries data. The default value is 30 seconds. Reintroduced in 1.1.0. _APP_USAGE_TIMESERIES_INTERVAL version >= 1.0.0 Deprecated since 1.1.0 use _APP_USAGE_AGGREGATION_INTERVAL instead. _APP_USAGE_DATABASE_INTERVAL version >= 1.0.0 Deprecated since 1.1.0 use _APP_USAGE_AGGREGATION_INTERVAL instead. _APP_WORKER_PER_CORE version >= 0.13.0 Internal Worker per core for the API, Realtime and Executor containers. Can be configured to optimize performance. \"]}, {\"level\": 2, \"title\": \"Redis\", \"body\": [\"Appwrite uses a Redis server for managing cache, queues and scheduled tasks. The Redis env vars are used to allow Appwrite server to connect to the Redis container.\", \" Name Description _APP_REDIS_HOST Redis server hostname address. Default value is: 'redis'. _APP_REDIS_PORT Redis server TCP port. Default value is: '6379'. _APP_REDIS_USER version >= 0.7 Redis server user. This is an optional variable. Default value is an empty string. _APP_REDIS_PASS version >= 0.7 Redis server password. This is an optional variable. Default value is an empty string. \"]}, {\"level\": 2, \"title\": \"MariaDB\", \"body\": [\"Appwrite is using a MariaDB server for managing persistent database data. The MariaDB env vars are used to allow Appwrite server to connect to the MariaDB container.\", \" Name Description _APP_DB_HOST MariaDB server host name address. Default value is: 'mariadb'. _APP_DB_PORT MariaDB server TCP port. Default value is: '3306'. _APP_DB_SCHEMA MariaDB server database schema. Default value is: 'appwrite'. _APP_DB_USER MariaDB server user name. Default value is: 'user'. _APP_DB_PASS MariaDB server user password. Default value is: 'password'. _APP_DB_ROOT_PASS MariaDB server root password. Default value is: 'rootsecretpassword'. \"]}, {\"level\": 2, \"title\": \"InfluxDB\", \"body\": [\"Appwrite uses an InfluxDB server for managing time-series data and server stats. The InfluxDB env vars are used to allow Appwrite server to connect to the InfluxDB container.\", \" Name Description _APP_INFLUXDB_HOST InfluxDB server host name address. Default value is: 'influxdb'. _APP_INFLUXDB_PORT InfluxDB server TCP port. Default value is: '8086'. \"]}, {\"level\": 2, \"title\": \"StatsD\", \"body\": [\"Appwrite uses a StatsD server for aggregating and sending stats data over a fast UDP connection. The StatsD env vars are used to allow Appwrite server to connect to the StatsD container.\", \" Name Description _APP_STATSD_HOST StatsD server host name address. Default value is: 'telegraf'. _APP_STATSD_PORT StatsD server TCP port. Default value is: '8125'. \"]}, {\"level\": 2, \"title\": \"SMTP\", \"body\": [\"Appwrite is using an SMTP server for emailing your projects users and server admins. The SMTP env vars are used to allow Appwrite server to connect to the SMTP container.If running in production, it might be easier to use a 3rd party SMTP server as it might be a little more difficult to set up a production SMTP server that will not send all your emails into your user\\\\'s SPAM folder.\", \" Name Description _APP_SMTP_HOST SMTP server host name address. Use an empty string to disable all mail sending from the server. The default value for this variable is an empty string _APP_SMTP_PORT SMTP server TCP port. Empty by default. _APP_SMTP_SECURE SMTP secure connection protocol. Empty by default, change to 'tls' if running on a secure connection. _APP_SMTP_USERNAME SMTP server user name. Empty by default. _APP_SMTP_PASSWORD SMTP server user password. Empty by default. \"]}, {\"level\": 2, \"title\": \"Phone\", \"body\": [\" Name Description _APP_SMS_PROVIDER version >= 0.15.0 Provider used for delivering SMS for Phone authentication. Use the following format: 'sms://[USER]:[SECRET]@[PROVIDER]'. Available providers are twilio, text-magic, telesign, msg91, and vonage. _APP_SMS_FROM version >= 0.15.0 Phone number used for sending out messages. Must start with a leading '+' and maximum of 15 digits without spaces (+123456789). \"]}, {\"level\": 2, \"title\": \"Storage\", \"body\": [\" Name Description _APP_STORAGE_LIMIT version >= 0.7.0 Maximum file size allowed for file upload. The default value is 30MB. You should pass your size limit value in bytes. _APP_STORAGE_PREVIEW_LIMIT version >= 0.13.4 Maximum file size allowed for file image preview. The default value is 20MB. You should pass your size limit value in bytes. _APP_STORAGE_ANTIVIRUS This variable allows you to disable the internal anti-virus scans. This value is set to 'disabled' by default, to enable the scans set the value to 'enabled'. Before enabling, you must add the ClamAV service and depend on it on main Appwrite service. _APP_STORAGE_ANTIVIRUS_HOST version >= 0.7.0 ClamAV server host name address. Default value is: 'clamav'. _APP_STORAGE_ANTIVIRUS_PORT version >= 0.7.0 ClamAV server TCP port. Default value is: '3310'. _APP_STORAGE_DEVICE version >= 0.13.0 Select default storage device. The default value is 'local'. List of supported adapters are 'local', 's3', 'dospaces', 'backblaze', 'linode' and 'wasabi'. _APP_STORAGE_S3_ACCESS_KEY version >= 0.13.0 AWS S3 storage access key. Required when the storage adapter is set to S3. You can get your access key from your AWS console _APP_STORAGE_S3_SECRET version >= 0.13.0 AWS S3 storage secret key. Required when the storage adapter is set to S3. You can get your secret key from your AWS console. _APP_STORAGE_S3_REGION version >= 0.13.0 AWS S3 storage region. Required when storage adapter is set to S3. You can find your region info for your bucket from AWS console. _APP_STORAGE_S3_BUCKET version >= 0.13.0 AWS S3 storage bucket. Required when storage adapter is set to S3. You can create buckets in your AWS console. _APP_STORAGE_DO_SPACES_ACCESS_KEY version >= 0.13.0 DigitalOcean spaces access key. Required when the storage adapter is set to DOSpaces. You can get your access key from your DigitalOcean console. _APP_STORAGE_DO_SPACES_SECRET version >= 0.13.0 DigitalOcean spaces secret key. Required when the storage adapter is set to DOSpaces. You can get your secret key from your DigitalOcean console. _APP_STORAGE_DO_SPACES_REGION version >= 0.13.0 DigitalOcean spaces region. Required when storage adapter is set to DOSpaces. You can find your region info for your space from DigitalOcean console. _APP_STORAGE_DO_SPACES_BUCKET version >= 0.13.0 DigitalOcean spaces bucket. Required when storage adapter is set to DOSpaces. You can create spaces in your DigitalOcean console. _APP_STORAGE_BACKBLAZE_ACCESS_KEY version >= 0.14.2 Backblaze access key. Required when the storage adapter is set to Backblaze. Your Backblaze keyID will be your access key. You can get your keyID from your Backblaze console. _APP_STORAGE_BACKBLAZE_SECRET version >= 0.14.2 Backblaze secret key. Required when the storage adapter is set to Backblaze. Your Backblaze applicationKey will be your secret key. You can get your applicationKey from your Backblaze console. _APP_STORAGE_BACKBLAZE_REGION version >= 0.14.2 Backblaze region. Required when storage adapter is set to Backblaze. You can find your region info from your Backblaze console. _APP_STORAGE_BACKBLAZE_BUCKET version >= 0.14.2 Backblaze bucket. Required when storage adapter is set to Backblaze. You can create your bucket from your Backblaze console. _APP_STORAGE_LINODE_ACCESS_KEY version >= 0.14.2 Linode object storage access key. Required when the storage adapter is set to Linode. You can get your access key from your Linode console. _APP_STORAGE_LINODE_SECRET version >= 0.14.2 Linode object storage secret key. Required when the storage adapter is set to Linode. You can get your secret key from your Linode console. _APP_STORAGE_LINODE_REGION version >= 0.14.2 Linode object storage region. Required when storage adapter is set to Linode. You can find your region info from your Linode console. _APP_STORAGE_LINODE_BUCKET version >= 0.14.2 Linode object storage bucket. Required when storage adapter is set to Linode. You can create buckets in your Linode console. _APP_STORAGE_WASABI_ACCESS_KEY version >= 0.14.2 Wasabi access key. Required when the storage adapter is set to Wasabi. You can get your access key from your Wasabi console. _APP_STORAGE_WASABI_SECRET version >= 0.14.2 Wasabi secret key. Required when the storage adapter is set to Wasabi. You can get your secret key from your Wasabi console. _APP_STORAGE_WASABI_REGION version >= 0.14.2 Wasabi region. Required when storage adapter is set to Wasabi. You can find your region info from your Wasabi console. _APP_STORAGE_WASABI_BUCKET version >= 0.14.2 Wasabi bucket. Required when storage adapter is set to Wasabi. You can create buckets in your Wasabi console. \"]}, {\"level\": 2, \"title\": \"Functions\", \"body\": [\" Name Description _APP_FUNCTIONS_SIZE_LIMIT version >= 0.13.0 The maximum size deployment in bytes. The default value is 30MB. _APP_FUNCTIONS_TIMEOUT version >= 0.7.0 The maximum number of seconds allowed as a timeout value when creating a new function. The default value is 900 seconds. This is the global limit, timeout for individual functions are configured in the function's settings or in appwrite.json. _APP_FUNCTIONS_BUILD_TIMEOUT version >= 0.13.0 The maximum number of seconds allowed as a timeout value when building a new function. The default value is 900 seconds. _APP_FUNCTIONS_CONTAINERS version >= 0.7.0 The maximum number of containers Appwrite is allowed to keep alive in the background for function environments. Running containers allow faster execution time as there is no need to recreate each container every time a function gets executed. The default value is 10. _APP_FUNCTIONS_CPUS version >= 0.7.0 The maximum number of CPU core a single cloud function is allowed to use. Please note that setting a value higher than available cores will result in a function error, which might result in an error. The default value is empty. When it's empty, CPU limit will be disabled. _APP_FUNCTIONS_MEMORY version >= 0.7.0 The maximum amount of memory a single cloud function is allowed to use in megabytes. The default value is empty. When it's empty, memory limit will be disabled. _APP_FUNCTIONS_MEMORY_SWAP version >= 0.7.0 The maximum amount of swap memory a single cloud function is allowed to use in megabytes. The default value is empty. When it's empty, swap memory limit will be disabled. _APP_FUNCTIONS_RUNTIMES version >= 0.8.0 This option allows you to enable or disable runtime environments for cloud functions. Disable unused runtimes to save disk space.To enable cloud function runtimes, pass a list of enabled environments separated by a comma.Currently, supported environments are: node-14.5, node-16.0, node-18.0, php-8.0, php-8.1, ruby-3.0, ruby-3.1, python-3.8, python-3.9, python-3.10, deno-1.21, deno-1.24, dart-2.15, dart-2.16, dart-2.17, dotnet-3.1, dotnet-6.0, java-8.0, java-11.0, java-17.0, java-18.0, swift-5.5, kotlin-1.6, cpp-17.0 _APP_EXECUTOR_SECRET version >= 0.13.0 The secret key used by Appwrite to communicate with the function executor. Make sure to change this! _APP_EXECUTOR_HOST version >= 0.13.0 The host used by Appwrite to communicate with the function executor! _APP_EXECUTOR_RUNTIME_NETWORK version >= 0.13.0 Deprecated with 0.14.0, use 'OPEN_RUNTIMES_NETWORK' instead! _APP_FUNCTIONS_ENVS version >= 0.7.0 Deprecated with 0.8.0, use '_APP_FUNCTIONS_RUNTIMES' instead! _APP_FUNCTIONS_INACTIVE_THRESHOLD version >= 0.13.0 The minimum time a function must be inactive before it can be shut down and cleaned up. This feature is intended to clean up unused containers. Containers may remain active for longer than the interval before being shut down, as Appwrite only cleans up unused containers every hour. If no value is provided, the default is 60 seconds. DOCKERHUB_PULL_USERNAME version >= 0.10.0 The username for hub.docker.com. This variable is used to pull images from hub.docker.com. DOCKERHUB_PULL_PASSWORD version >= 0.10.0 The password for hub.docker.com. This variable is used to pull images from hub.docker.com. DOCKERHUB_PULL_EMAIL version >= 0.10.0 The email for hub.docker.com. This variable is used to pull images from hub.docker.com. OPEN_RUNTIMES_NETWORK version >= 0.13.0 The docker network used for communication between the executor and runtimes. Change this if you have altered the default network names. \"]}, {\"level\": 2, \"title\": \"Maintenance\", \"body\": [\" Name Description _APP_MAINTENANCE_INTERVAL version >= 0.7.0 Interval value containing the number of seconds that the Appwrite maintenance process should wait before executing system cleanups and optimizations. The default value is 86400 seconds (1 day). _APP_MAINTENANCE_RETENTION_CACHE version >= 1.0.0 The maximum duration (in seconds) upto which to retain cached files. The default value is 2592000 seconds (30 days). _APP_MAINTENANCE_RETENTION_EXECUTION version >= 0.7.0 The maximum duration (in seconds) upto which to retain execution logs. The default value is 1209600 seconds (14 days). _APP_MAINTENANCE_RETENTION_AUDIT version >= 0.7.0 IThe maximum duration (in seconds) upto which to retain audit logs. The default value is 1209600 seconds (14 days). _APP_MAINTENANCE_RETENTION_ABUSE version >= 0.7.0 The maximum duration (in seconds) upto which to retain abuse logs. The default value is 86400 seconds (1 day). _APP_MAINTENANCE_RETENTION_USAGE_HOURLY The maximum duration (in seconds) upto which to retain hourly usage metrics. The default value is 8640000 seconds (100 days). \"]}]", "metadata": {"source": "https://appwrite.io/docs/environment-variables"}} \ No newline at end of file diff --git a/docs/ee44000c-1f0c-11ee-98fa-00155da08df7.json b/docs/ee44000c-1f0c-11ee-98fa-00155da08df7.json deleted file mode 100644 index 4ebf854..0000000 --- a/docs/ee44000c-1f0c-11ee-98fa-00155da08df7.json +++ /dev/null @@ -1 +0,0 @@ -{"page_content": "[{\"level\": 1, \"title\": \" Production \", \"body\": [\"Appwrite default setup is designed to help you get started quickly with using the Appwrite server. To run Appwrite successfully in a production environment, you should follow a few basic concepts and best practices. This document assumes you have some very basic understanding of Docker and Docker Compose command-line tools.\"]}, {\"level\": 2, \"title\": \"Encryption\", \"body\": [\"By default, the Appwrite setup doesn't come with a uniquely generated encryption key. This key is used to store your files and sensitive data like webhook passwords or API keys in a safe way. To take advantage of this feature, you must generate a unique key and set it as the value of the _APP_OPENSSL_KEY_V1 environment variable.\", \"Make sure to keep this key in a safe place and never make it publicly accessible. There are many online resources with methods of keeping your secret keys safe in your servers.\", \" Best Practice You should always prefer https over http in production environments. This keeps your APIs secure and prevents any redirects from interfering with your requests.\"]}, {\"level\": 2, \"title\": \"Limit Console Access\", \"body\": [\"By default, anyone can signup for your Appwrite server, create projects, and use your computing power. While this is great for testing around or running your Appwrite service in a network isolated environment, it is highly not recommended for public production use.\", \"We are providing three different methods to limit access to your Appwrite console. You can either set a list of IPs or email address which users are allowed to signup from. You can choose one or multiple restriction methods to apply.\"]}, {\"level\": 2, \"title\": \"Scaling\", \"body\": [\"Appwrite was built with scalability in mind. Appwrite can scale both horizontally and vertically.\", \"Appwrite uses a few containers to run, where each container has its job. Most of the Appwrite containers are stateless, and in order to scale them, all you need is to replicate them and setup a load balancer to distribute their load.\", \"If you decide to set up a load balancer for a specific container, make sure that the containers that are trying to communicate with it are accessing it through a load balancer and not directly. All connections between Appwrite different containers are set using Docker environment variables.\", \"There are three Appwrite containers that do keep their state. MariaDB, Redis, and InfluxDB containers are used for storing data, cache and pub/sub messaging, and usage stats (in this order). To scale them out, all you need to do is set up a standard cluster (same as you would with any other app using these technologies) according to your needs and performance.\"]}, {\"level\": 2, \"title\": \"Enable Rate Limits\", \"body\": [\"If you disabled rate limits during development, make sure you re-enable them when moving to production environments. Rate limiting can be enabled by setting the _APP_OPTIONS_ABUSE environment variable to enabled.\", \"Learn more about environment variables\"]}, {\"level\": 2, \"title\": \"Emails\", \"body\": [\"Sending emails is hard. There are a lot of spam rules and configurations to master in order to set up a functional SMTP server. While it is okay to use a self-hosted SMTP server during development, you should use a third-party SMTP provider for production so your email doesn't get labeled as spam.\", \"You can change Appwrite's SMTP settings and credentials to any 3rd party provider you like that supports SMTP integration using our Docker environment variables. Most SMTP providers offer a decent free tier to get started with.\"]}, {\"level\": 2, \"title\": \"Backups\", \"body\": [\"Backups are highly recommended for any production environment. Currently, there is no built-in script we provide to do this automatically. To be able to backup your Appwrite server data, stats, and files, you will need to do the following.\", \" Create a script to backups and restore your MariaDB Appwrite schema. Note that trying to backup MariaDB using a docker volume backup can result in a corrupted copy of your data. It is recommended to use MariaDB or MySQL built-in tools for this. Create a script to backups and restore your InfluxDB stats. If you don't care much about your server stats, you can skip this. Create a script to backup Appwrite storage volume. There are many online resources explaining different ways to backup a docker volume. When running on multiple servers, it is very recommended to use an attachable storage point. Some cloud providers offer integrated backups to such attachable mount like GCP, AWS, DigitalOcean, and the list continues.\"]}]", "metadata": {"source": "https://appwrite.io/docs/production"}} \ No newline at end of file diff --git a/scrape.py b/scrape.py index a68ad99..38bf5b9 100644 --- a/scrape.py +++ b/scrape.py @@ -5,13 +5,24 @@ import requests from bs4 import BeautifulSoup +import re -def get_appwrite_data(path: str): - url = f"https://appwrite.io/docs/{path}" +def extract_hrefs(html_code): + hrefs = re.findall(r'href=["\'](.*?)["\']', html_code) + return hrefs + +def get_appwrite_data(url: str): + print(f"Getting data from {url}...") data = requests.get(url).text soup = BeautifulSoup(data, 'html.parser') - content = soup.select('.docs > .row > .col:nth-child(2) > article')[0] + contents = soup.select('.docs > .row > .col:nth-child(2) > article') + if len(contents) == 0: + return dict( + page_content=json.dumps(data), + metadata={"source": url}, + ) + content = contents[0] sections = [] current_section = None @@ -41,61 +52,40 @@ def get_appwrite_data(path: str): ) -sources = [ - get_appwrite_data("getting-started-for-web"), - get_appwrite_data("getting-started-for-flutter"), - get_appwrite_data("getting-started-for-apple"), - get_appwrite_data("getting-started-for-android"), - get_appwrite_data("getting-started-for-server"), - get_appwrite_data("command-line"), - get_appwrite_data("command-line-deployment"), - get_appwrite_data("command-line-commands"), - get_appwrite_data("command-line-ci"), - get_appwrite_data("sdks"), - get_appwrite_data("rest"), - get_appwrite_data("graphql"), - get_appwrite_data("realtime"), - get_appwrite_data("client/account"), - get_appwrite_data("server/users"), - get_appwrite_data("client/teams"), - get_appwrite_data("client/databases"), - get_appwrite_data("client/storage"), - get_appwrite_data("client/functions"), - get_appwrite_data("client/locale"), - get_appwrite_data("client/avatars"), - get_appwrite_data("server/health"), - get_appwrite_data("databases"), - get_appwrite_data("databases-queries"), - get_appwrite_data("databases-pagination"), - get_appwrite_data("databases-relationships"), - get_appwrite_data("storage"), - get_appwrite_data("authentication"), - get_appwrite_data("authentication-server"), - get_appwrite_data("authentication-security"), - get_appwrite_data("functions"), - get_appwrite_data("keys"), - get_appwrite_data("permissions"), - get_appwrite_data("events"), - get_appwrite_data("queries"), - get_appwrite_data("pagination"), - get_appwrite_data("webhooks"), - get_appwrite_data("custom-domains"), - get_appwrite_data("response-codes"), - get_appwrite_data("rate-limits"), - get_appwrite_data("self-hosting"), - get_appwrite_data("configuration"), - get_appwrite_data("environment-variables"), - get_appwrite_data("email-delivery"), - get_appwrite_data("sms-delivery"), - get_appwrite_data("certificates"), - get_appwrite_data("debugging"), - get_appwrite_data("upgrade"), - get_appwrite_data("production"), -] +links = [] +def get_docs_data(base: str, path: str = ""): + print() + data = requests.get(f"{base}{path}").text + hrefs = extract_hrefs(data) + print(f"Found {len(hrefs)} links in {base}{path}") + + + for href in hrefs: + newPath = href.split("#")[0] + newUrl = f"{base}{newPath}" + if newPath and newPath.startswith("/docs") and newUrl not in links: + print(f"Found new valid link {newUrl}") + links.append(newUrl) + print(f"New total links: {len(links)}") + get_docs_data(base, newPath) + + + +get_docs_data("http://167.172.175.165:2080") +print(f"\nTotal docs links found: {len(links)}") + +print("Getting data from links...") +sources = [get_appwrite_data(link) for link in links] +print("Done!") + +print(f"Total sources: {len(sources)}") +print("\nSaving data...") # Delete all files in docs for filename in os.listdir("docs"): os.remove(f"docs/{filename}") for source in sources: - json.dump(source, open(f"docs/{uuid1()}.json", "w")) + with open(f"docs/{uuid1()}.json", "w") as f: + json.dump(source, f) +print("Done! Bye!") \ No newline at end of file